Day 33 JDBC
Day 33 JDBC
⮚ JDBC is API that helps a programmer to write a java program to connect to any Database,
retrieve the data from the Database
⮚ Java.sql or java.sqlx is a package
Oracle Database
⮚ RDBMS: this will enable us to create a database and maintain the database it will provide us
an interface between the Programmer and Database
⮚ User is communicating with the Database DBMS in which Language: SQL
Way1:
Class.forName(“oracle.jdbc.driver.oracleDriver”);
This will allows registration,Configurable & portable
Way2:
DriverManager.registerDriver(“oracle.jdbc.driver.oracleDriver”);
1. getConnection(String Url)
2. getConnection(String URL,properties prop);
3. getConnection(String URL,String Username,String Password)
URL: jdbc:oracle:thin:@hostname:port_Number:databaseName
Executing query:
1. Boolean execute (String query);
2. Int executeUpdate(String query);
3. Resultset Executequery(String query);-table
Sequence