Java Project Workshop - JDBC
Java Project Workshop - JDBC
(JDBC – Part 2)
Lecture 2
Step-3
(Opening The Connection)
• Syntax:
public static Connection getConnection
(String url,String name,String password) throws SQLException
• Example:
Connection conn=DriverManager.getConnection(
"jdbc:oracle:thin:@//localhost:1521/xe",“project",“java");
Step-4
(Create The Statement Object)
• For example, getInt() gets the column value as an int, getString() gets
the column value as a String, and getDate() returns the column value
as a Date.
Step- 6
(Process The Result)
• These getXXX() methods have 2 versions: