WHAT ARE THE STEPS IN THE JDBC CONNECTION?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
Java 
 1023  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What are the steps in the JDBC connection?

    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();

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!