JDBC by Examples

The Java Database Connectivity (JDBC) API is a collection of classes and interfaces, and is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases and other tabular data sources.

JDBC technology allows you to use the Java programming language to connect to SQL based relational databases and obtain the data available in the databases. Normally, to use JDBC, it will include the following steps:

  • Making a connection to a database
  • Creating SQL or MySQL statements
  • Executing that SQL or MySQL queries in the database
  • Viewing & Modifying the resulting records

The post will discuss JDBC by examples:
(Those examples need MySQL JDBC driver. MySQL Connector/J is the official JDBC driver for MySQL. Download MySQL JDBC driver from MySQL site)

  1. Create JDBC Connection
  2. JDBC Create Database
  3. JDBC Drop Database
  4. JDBC Create Table
  5. JDBC Drop Table
  6. JDBC Insert Records Using Statement
  7. JDBC Insert Records Using PreparedStatement
  8. JDBC Select Records
  9. JDBC Update Records Using Statement
  10. JDBC Update Records Using PreparedStatement
  11. JDBC Delete Record Using Statement
  12. JDBC Delete Record Using PreparedStatement
  13. JDBC Batch Update
  14. JDBC CallableStatement

(to be continued)

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on RedditShare on StumbleUponEmail this to someoneShare on TumblrDigg this

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">