This example will show you how to use java.sql.CallableStatement to get output data from stored procedure. This example will use Microsoft Sql Server, the java code for other databases is […]
This example will show you how to use java.sql.CallableStatement to call a Microsoft Sql Server stored procedure with input parameters. If you use other database such as oracle, Mysql etc, […]
java.sql.PreparedStatement class is more powerful and efficient than java.sql.Statement, This example will show you how to execute PreparedStatement in batch.
If you need to switch between different databases using JDBC, you can store different database JDBC connection related information in a properties file. This example will show you how to […]
This article will tell you how to connect Microsoft SQL Server use JDBC. You can access Sql Server use JDBC with following two methods. Use com.microsoft.sqlserver.jdbc.SQLServerDataSource java object. SQLServerDataSource sqlDs […]
java.sql.PreparedStatement is a more powerful database operation class than java.sql.Statement. You can send a pre-compiled SQL statement to the database server with specified parameters. It is more efficient than java.sql.Statement […]
When you have a lot of insert or update sql commands to execute, you can use java.sql.Statement addBatch(String sqlCmd) method to group them together and then run java.sql.Statement executeBatch() to commit all […]
java.sql.DatabaseMetaData interface provide methods to get meta data of your connected database server. Below examples will show you how to do that one by one.
To select data from table use java.sql.PreparedSatement, you need first create a select sql command, and then get data list by execute java.sql.PreparedSatement.executeQuery() method. This article will show you examples.
This article will show you how to use java.sql.Statement to execute insert, update, delete and select sql dml commands with examples.