JDBC Connection Database
Jndi Connection Pool
JDBC Driver package: Used to connect Oracle, it is provided by Oracle itself, directory D:\app\Administrator\product\11.2.0\dbhome_1\jdbc\ Lib under ojdbc6.jar--copy the driver package to the project's Lib folder
Right-click Project name--build path--Configure build Path--java build Path--libraries--add jars--Select Project Lib folder Ojdbc6.jar
MyEclipse DataBase Explorer-MyEclipse Derby-Right-click New--database driver complete configuration--test driver succeeded-copy connection URL to notepad--copy driver classname to Notepad at the same time
java.sql interface Connection---Connection to a specific database (session)
The principle of using database connection:
Open late, early off---purpose is to conserve resources
Interface Statement executes a static SQL statement---and returns
---executeQuery executes the given SQL statement, the statement returns a single ResultSet object
Interface ResultSet---a data table that represents a database result set, typically generated by executing statements that query the database.
Transaction (Transaction): Acid Properties
Multi-step operation on the database while successfully and simultaneously failing
Oo thought: SRP/OCP
Core idea: Three Layer development UI-->> Biz-->> DAO Call relationship
1, a UI method is best to tune only a biz public method
2. The public method of a biz can invoke multiple methods of multiple DAO
Java Series--JDBC Connect Oracle