users@glassfish.java.net

Re: Where is com.sun.appserv.DataSource ?

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Fri, 11 May 2007 18:41:48 -0700

glassfish_at_javadesktop.org wrote On 05/11/07 14:39,:

>Hello,
>
>I just read this tutorial https://glassfish.dev.java.net/javaee5/docs/DG/beamj.html#beams and created a JDBC connection pool for my MySQL database.
>
>Now I want to use to my JDBC connection pool with this code :
>
>InitialContext ctx = new InitialContext();
>com.sun.appserv.DataSource ds = (com.sun.appserv.DataSource)
> ctx.lookup("jdbc/MyBase");
>Connection con = ds.getConnection();
>Connection drivercon = ds.getConnection(con);
>// Do db operations.
>con.close();
>
>The problem is that I don't have the class com.sun.appserv.DataSource in my class path and can't find the jar file where this class is located (I already try to import all jar in the glassfish lib directory). Where is this class ?
>
>

This is not really my area of expertise, but it looks like
com.sun.appserv.DataSource was changed
to com.sun.appserv.jdbc.DataSource (see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4917147:
"com.sun.appserv.DataSource should be com.sun.appserv.jdbc.DataSource"),
which is included in appserv-ext.jar,
but the tutorial was never updated.

If so, can you file a bug against docs?


Jan