Differences between revisions 7 and 8
Revision 7 as of 2014-04-16 07:32:18
Size: 1509
Comment: Changed to FAQ format
Revision 8 as of 2014-08-04 14:26:03
Size: 1972
Comment: Added information about JDBC 3 and Tomcat 8
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
 1. [[#Q3|How to use JDBC 3 driver with Tomcat 8?]]
Line 34: Line 35:
<<Anchor(Q3)>>
=== How to use JDBC 3 driver with Tomcat 8 / DBCP 2? ===

One of the connection pool implementations in Tomcat 8 is DBCP 2, and DBCP 2 calls Connection.isValid(int) method when no validationQuery is specified. IsValid(int) method is introduced with JDBC 4. If you must use JDBC 3 driver with Tomcat 8 / DBCP 2, make sure that you specify validationQuery attribute in pool configuration.

Preface

This page is to discuss database error and DBCP. Until more content can appear here, here are some links to the mail archives to perform some searches:

Other Links of interest:

Questions

  1. Is it safe to use JDBC-ODBC bridge in production environment?

  2. How to use Orache thin driver?

  3. How to use JDBC 3 driver with Tomcat 8?

Answers

Is it safe to use JDBC-ODBC bridge in production environment?

No, do not use JDBC-ODBC bridge bundled with Sun's JDK with Tomcat. It was never meant for a production server environment. If you ask a question about it, everyone will tell you to not use it. If you do need to use ODBC, there are 3rd party drivers which do a pretty good job at being thread safe.

How to use Orache thin driver?

If you use the oracle thin driver, be sure to rename it to a jar file from a zip file. Tomcat only auto-magically loads files ending in .jar placed in a lib directory. It ignores all other file extensions.

How to use JDBC 3 driver with Tomcat 8 / DBCP 2?

One of the connection pool implementations in Tomcat 8 is DBCP 2, and DBCP 2 calls Connection.isValid(int) method when no validationQuery is specified. IsValid(int) method is introduced with JDBC 4. If you must use JDBC 3 driver with Tomcat 8 / DBCP 2, make sure that you specify validationQuery attribute in pool configuration.


CategoryFAQ

FAQ/Database (last edited 2014-08-04 14:26:03 by OgnjenBlagojevic)