JDBC Drive For Mysql

In this Tutorial we want to describe you a code that help you in understanding JDBC Drive for Mysql.

Ads

Tutorials   
JDBC Video Tutorial: Create, Read, Update and Delete (CRUD) Operation examples JDBC Video tutorial - How to read Data from MySQL Database? JDBC Video tutorial - How to delete Data in a MySQL Database? Solving java.lang.ClassNotFoundException: com.mysql.jdbc.Driver exception JDBC Video tutorial - How to update Data in a MySQL Database? JDBC Video Tutorial- How to insert data into MySQL database table? JDBC Video Tutorial: How to download JDBC Driver for MySQL? JDBC Tutorial - Writing first JDBC example and running in Eclipse Java Cross Join MySQL Database Connectivity Example In Java Change Column Name in MySQL Java Mysql Connection Example JDBC ODBC Connection In Java ResultSet In Java Prepared Statement Example JdbcRowSet interface Java JdbcRowSet Example First Step towards JDBC! JDBC Training, Learn JDBC yourself Jdbc Get Column Names JDBC Example with MySQL JDBC Prepared Statement Update JDBC Prepared Statement Insert JDBC Prepared Statement Example JDBC Prepared statement Close JDBC Prepared Statement Addbatch JDBC Nested Resultset JDBC-Odbc Connection JDBC-Odbc Connectivity JDBC Insert Preparedstatement JDBC Insert Null JDBC Get Metadata JDBC Insert Record Jdbc Insert Statement JDBC Meta Data Get tables Jdbc Mysql Connection String Jdbc Mysql Connection Url JDBC Next Jdbc Get Connection JDBC Get Int JDBC Exception JDBC Get Row Count JDBC Functions JDBC Fetch JDBC Execute Update Example JDBC Execute Statement JDBC Execute Query JDBC Drive For Mysql JDBC Connectivity Code In Java JDBC connection timeout
Ads

JDBC Drive For Mysql

     

In this Tutorial we want to describe you a code that help you in understanding JDBC Drive for Mysql. The code include a class JdbDriveForMysql,Inside the main method we declared a string driver initialized  with "com.mysql.jdbc.Driver".The try block include the following steps-

Driver loading: loading a driver is the first step by calling a class.forname( ) and passed driver class as argument. Once the driver is loaded ,you connect the front end of the Java application to the backend database. In case there will be an exception occurred  in loading a database driver  in the try block. The catch block check the exception and println print the exception.

Finally the println print the value of  jdbc driver for mysql is specified in string driver. 

JdbcDriveForMysql .java


public class JdbcDriveForMysql {
  public static void main(String args[]) {
  String driver = "com.mysql.jdbc.Driver";
  try {
  Class.forName(driver);
  System.out.println("jdbc driver for mysql : " + driver);
  catch (Exception e) {
  System.out.println(e);
  }
  }
}

Output

jdbc driver for mysql : com.mysql.jdbc.Driver

Download code

Advertisements

Share on Google+Share on Google+

JDBC Drive For Mysql

Posted on: November 17, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: JDBC Drive For Mysql   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads