JDBC
Java Database Connectivity
JDBC简介
SQL语言回顾
JDBC基础编程
JDBC编程高级
DataSource and RowSet
SQL语言回顾
Select
Insert
Create
Delete
Update
Drop
JDBC 编程步骤
1. Load the Driver
(1)Class.forName()|Class.forName().newlnstance()|new DriverName()
(2)实例化时自动向DriverManager注册,不需显示调用DriverManager.registerDriver 方法
2. Connect to the DataBase
(1)DriverManager.getConnectioin()
3. Execute the SQL
(1)Connectioin.CreateStatement()
(2)Statement.executeQuery()
(3)Statement.executeUpdate()
4. Retrieve the result data
(1)循环取得结果 while(rs.next())
5. Show the result data
(1)将数据库中的各种类型转换为java中的类型(getxxx)方法
6. Close
(1)close the resultset / close the statement / close the connectioin