Prinrose 3.0.13 + Tomcat 6 + code = ? :-)  
Linda Wed Mar 18 06:53:16 GMT 2009
 
Hi,

I'd like to move from DBpool to Primrose to see if it's better.
Primrose seems correctly installed because I'm able to get the web console.
My problem comes from the java code. I followed your example in the documentation but I get an error during the compilation
Do I need some "import" or other piece of code ?

package com.tutos.database;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;
import java.util.*;
import java.util.concurrent.*;

public class MysqlPool
{
public static Connection getConnection(String user, String pass) throws SQLException {
InitialContext ctx = new InitialContext();
PoolLoader pl = (PoolLoader)ctx.lookup("java:comp/env/AllPrimrosePools");
Pool myPool = pl.findExistingPool("myPoolName");
if (myPool != null) {
return myPool.getConnection();
} else {
throw new Exception("Cannot find pool");
}
}
}

the previous code generates 3 errors during the compilation ...

./com/tutos/database/MysqlPool.java:19: cannot find symbol
symbol : class PoolLoader
location: class com.tutos.database.MysqlPool
PoolLoader pl = (PoolLoader)ctx.lookup("java:comp/env/AllPrimrosePools");
^
./com/tutos/database/MysqlPool.java:19: cannot find symbol
symbol : class PoolLoader
location: class com.tutos.database.MysqlPool
PoolLoader pl = (PoolLoader)ctx.lookup("java:comp/env/AllPrimrosePools");
^
./com/tutos/database/MysqlPool.java:20: cannot find symbol
symbol : class Pool
location: class com.tutos.database.MysqlPool
Pool myPool = pl.findExistingPool("myPoolName");
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors


Any ideas ?
Cheers,
Linda (not really a java developer)
 
Rajesh Wed Mar 18 13:46:22 GMT 2009
 
Please import the following package:

uk.org.primrose.pool.core.PoolLoader;
Rajesh Wed Mar 18 13:48:10 GMT 2009
 
Also import uk.org.primrose.pool.core.Pool

or just import uk.org.primrose.pool.core.*;
Linda Thu Mar 19 02:11:06 GMT 2009
 
Thanks, it works now :)
guest Fri Jun 04 17:34:02 BST 2010
 
ta6g6a yabefngtvzfi, [url=http://qmhwvbzeklyp.com/]qmhwvbzeklyp[/url], [link=http://kyafubwglsoj.com/]kyafubwglsoj[/link], http://zftrrraloewo.com/