集册 Java 面试笔记 What are the steps in the JDBC connection?

What are the steps in the JDBC connection?

欢马劈雪     最近更新时间:2020-08-04 05:37:59

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