Top "Jdbc" questions

JDBC (Java DataBase Connectivity) is the base API which enables interacting with SQL database servers by executing SQL statements using the Java programming language.

TNS-12505: TNS:listener does not currently know of SID given in connect descriptor

I'm trying to connect to Oracle 10.2.0 from NetBeans, using the following connection string: jdbc:oracle:thin:@localhost:1521:XE The weirdest …

oracle jdbc listener tnsnames
How can I get the SQL of a PreparedStatement?

I have a general Java method with the following method signature: private static ResultSet runSQLResultSet(String sql, Object... queryParams) It …

java sql jdbc prepared-statement
Difference between Statement and PreparedStatement

The Prepared Statement is a slightly more powerful version of a Statement, and should always be at least as quick …

java jdbc
java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver

I'm getting this exception when I try to run this program. It's one of the Microsoft examples. I've added the …

java sql-server jdbc driver sqlexception
URL string format for connecting to Oracle database with JDBC

I'm a newbie to Java-related web development, and I can't seem to get a simple program with JDBC working. I'm …

oracle jdbc oracle-xe
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

I wrote a Java Servlet program but when I run it, it was showing the Exception java.lang.ClassNotFoundException: oracle.…

java servlets jdbc tomcat7
Get the current date in java.sql.Date format

I need to add the current date into a prepared statement of a JDBC call. I need to add the …

java jdbc java.util.date
Using setDate in PreparedStatement

In order to make our code more standard, we were asked to change all the places where we hardcoded our …

java sql oracle jdbc prepared-statement
Connection pooling options with JDBC: DBCP vs C3P0

What is the best connection pooling library available for Java/JDBC? I'm considering the 2 main candidates (free / open-source): Apache DBCP …

java jdbc connection-pooling c3p0 apache-commons-dbcp
Must JDBC Resultsets and Statements be closed separately although the Connection is closed afterwards?

It is said to be a good habit to close all JDBC resources after usage. But if I have the …

java jdbc