File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes jdbc simple connection pool problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc simple connection pool problem" Watch "jdbc simple connection pool problem" New topic
Author

jdbc simple connection pool problem

Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Hi everyone, trying to do a simple connection pooling example. This is my code and the error message I get. I am using visual age, and running websphere test environment in it. Also, if it means something I am using running my app with struts as the controller.......
in init method of servlet that gets executed while websphere it starting up, i say -->
org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource ds = new org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource();
ds.setUser(dbLogin);
ds.setPassword(dbPassword);
ds.setServerName(dbServer);
ds.setDatabaseName("docserver");
ds.setUrl(dbUrl);
ds.setPortNumber(8080);
try {
Context ctx = new InitialContext();
ctx.bind("jdbc/docserverDB", ds);
} catch (NamingException nme) {
nme.printStackTrace();
}
it throws the following exception on the line ..new InitialContext();
javax.naming.ConfigurationException: URLToObjectFacility.badProtocoldocserver:1099
So I added the following lines in.
Hashtable hash = new Hashtable();
hash.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory");
and then changed the line saying new InitialContext(hash);
I then still got the same exception.
Can anyone please shed some light as to what I'm doing wrong.
All I want is to be able to use the connection pooling part of jdbc 2.0 (or 3.0) using mySql driver in my webapp.
Thanks for your replies
Darryl
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Soryy but I have no idea. I am using connection pooling, but using the class that I downloaded in www.javaexchange.com (DBConnectionBroket). it is really easy..
hope it helps..


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: jdbc simple connection pool problem
 
Similar Threads
InitialContext WebSphere 3.5.4
WebSphere Enterprise Applications
using datasource - connection pooling
WebSphere 3.5 Connectio pool ??
Coonection pooling in WAS6.1