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.

PreparedStatement with Statement.RETURN_GENERATED_KEYS

The only way that some JDBC drivers to return Statement.RETURN_GENERATED_KEYS is to do something of the following: …

java jdbc
Efficient way to do batch INSERTS with JDBC

In my app I need to do a lot of INSERTS. Its a Java app and I am using plain …

java sql performance jdbc
How do you access the value of an SQL count () query in a Java program

I want to get to the value I am finding using the COUNT command of SQL. Normally I enter the …

java sql jdbc count
How to get the number of columns from a JDBC ResultSet?

I am using CsvJdbc (it is a JDBC-driver for csv-files) to access a csv-file. I don't know how many columns …

java jdbc csv resultset
Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?

I want to create a database which does not exist through JDBC. Unlike MySQL, PostgreSQL does not support create if …

sql database postgresql jdbc ddl
How to set up datasource with Spring for HikariCP?

Hi I'm trying to use HikariCP with Spring for connection pool. I'm using jdbcTempLate and JdbcdaoSupport. This is my spring …

spring jdbc spring-jdbc jdbctemplate hikaricp
How should I use try-with-resources with JDBC?

I have a method for getting users from a database with JDBC: public List<User> getUser(int userId) { …

java jdbc java-7 try-with-resources
Writing a large resultset to an Excel file using POI

This is sort of inline w/ Writing a large ResultSet to a File but the file in question is an …

java jdbc apache-poi
Java program to connect to Sql Server and running the sample query From Eclipse

package sqlselection; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class …

java eclipse jdbc jdbc-odbc
Getting Database connection in pure JPA setup

We have a JPA application (using hibernate) and we need to pass a call to a legacy reporting tool that …

java hibernate orm jpa jdbc