shawn wrote:
> Thanks for the input Steve,
>
> I agree that it SHOULDN'T be dbpc, but it looks as if it is. Actually
> the driver does support it quite nicely. Everything works great if I
> create my connection manually. Things only break if I retrieve the
> connection from jndi ( and thus dbpc ).
>
> //This can use getGeneratedKeys()
> Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection conn
> =
> DriverManager.getConnection("jdbc:mysql://localhost:3306/testDB?user=-
> "+dbUser+"&password="+dbPass);
>
> //This cannot...... javax.naming.Context ctx = new
> javax.naming.InitialContext(); javax.sql.DataSource ds =
> (javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/testDB");
> Connection conn = ds.getConnection();
>
> As things stand now I must either give up connection pooling ( not a
> good option ) or create a workaround through sql ( decreased
> performance through through additional queries ).
>
I don't think you need worry about the performance - even if the driver
supports the getGeneratedKeys() method, it still has to make an sql
query ("SELECT LAST_INSERT_ID()" for MySQL) to get the information.
The only advantage is that getGeneratedKeys() is db-independent.
Martin
--
To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>