Home > DeveloperSection > Interviews > What are the steps in the JDBC connection?

Posted on    August-26-2014 12:09 AM

 Java Java 
Ratings:
 1 Answer(s)
  851  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Points:3910
Posted on    August-26-2014 12:00 AM

While making a JDBC connection we go through the following steps :

Step 1 : Register the database driver by using :

Class.forName(\" driver classs for that specific database\" );

Step 2 : Now create a database connection using :

Connection con = DriverManager.getConnection(url,username,password);

Step 3: Now Create a query using :

Statement stmt = Connection.Statement(\"select * from TABLE NAME\");

Step 4 : Exceute the query :

stmt.exceuteUpdate();


Don't want to miss updates? Please click the below button!

Follow MindStick