First off I would like to say I appreciate all your help very much.
Now, here's what I have.
I installed, and confirmed that it runs properly, the Connector/J v3 drivers. my resin.conf looks like this:
<resource-ref>
<res-ref-name>jdbc/FormsAreUs</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<!-- <res-type>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</res-type> -->
<init-param driver-name="com.mysql.jdbc.Driver"/>
<init-param url="jdbc:mysql://localhost:3306/FormsAreUs"/>
<init-param user="foo"/>
<init-param password="bar"/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref>
And when I 'use' this connection (in this case) I try with of the following example. (For brevity I have removes all 'error' checking etc, suffice it ot say the exception thrown is below).
Now I CAN get it to work with last_insert_id() but I would rather not have to use another round trip to the DB. Here is my code.
Example 1:
String sqlCommand = "INSERT INTO Questions (question, questionTypeID) VALUES ( " + pQuestion.getQuestion() + ", " + pQuestion.getQuestionTypeID() + ")";
Statement stmt2 = conn.createStatement( ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE );
stmt2.executeUpdate( sqlCommand, Statement.RETURN_GENERATED_KEYS );
ResultSet rs2 = stmt2.getGeneratedKeys();
int lastQuestionID = rs2.getInt( 1 );
THROWS: java.lang.AbstractMethodError: com.mysql.jdbc.jdbc2.Statement.executeUpdate(Ljava/lang/String;I)
Any help would be much appreciated.
Oh, the interesting this is that this 'stmt2.executeUpdate() works on other pages as I only use prepared statements if/when I can.
Thanks.
Mark Matthews wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Bateman wrote:Thanks for the tip.
I"ve upgraded to the Connector/J driver, but I am having problem configuring it. Do you have an y experience with Resin you could point how what should go where?
I can post my resin.conf file here if you like.
Thanks.
Have you tried something like: <resource-ref> <res-ref-name>jdbc/test</res-ref-name> <res-type>javax.sql.DataSource</res-type> <init-param driver-name="com.mysql.jdbc.Driver"/> <init-param url="jdbc:mysql://localhost:3306/test"/> <init-param user=""/> <init-param password=""/> <init-param max-connections="20"/> <init-param max-idle-time="30"/> </resource-ref> -Mark - -- MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/ For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mark Matthews <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA <___/ www.mysql.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.1.90 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+IsJ+tvXNTca6JD8RAuFuAJ0eNi9yVCakCjACiKFZ+jM8Zo07/QCdFrq0 YTrR3TQWMcOc4sD9STgEWVo= =hbKd -----END PGP SIGNATURE----- .
--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php