1、Connection类:
a、Statement creatStatement() throws SQLException
创建一个Statement对象;
b、Statement creatStatement(int resultSetType,int resultSetConcurrency) throws SQLException
创建一个Statement对象,该对象将生成具有给定类型和并发性的resultSet对象;
c、PreparedStatement preparedStatement(String sql) throws SQLException
创建一个PreparedStatement类型的对象;
d、PreparedStatement preparedStatement(String sql,int resultSetType,int resultSetConcurrency) throws SQLException
创建一个PreparedStatement类型的对象,该对象将生成具有给定类型和并发性的resultSet对象;
e、CallableStatement prepareCall(String sql) throws SQLException
创建一个CallableStatement对象,此对象专门用于调用数据库的存储过程;
f、CallableStatement prepareCall(String sql,int resultSetType,int resultSetConcurrency) throws SQLException
创建一个CallableStatement对象,该对象将生成具有给定类型和并发性的resultSet对象;
g、DatabaseMetaData getMetaData() throws SQLException
得到数据库的元数据;
h、void setAutoCommit(boolean autoCommit) throws SQLException
设置数据库的自动提交,与事物有关;
i、boolean getAutoCommit() throws SQLException
判断数据库是否可以自动提交,与事物有关;
j、Savepoint setSavepoint() throws SQLException
设置数据库的恢复点,与事物有关;
k、Savepoint setSavepoint(String name) throws SQLException
为数据库的恢复点指定一个名字,与事物有关;
l、void rollback() throws SQLException
设置数据库回滚,与事物有关;
m、void rollback(Savepoint savepoint) throws SQLException
设置数据库回滚的保存点,与事物有关;
n、void commint() throws SQLException
提交操作,与事物有关;
o、boolean isClosed() throws SQLException
判断连接是否关闭;
p、void closed() throws SQLException
关闭连接;
2、更新操作Statement接口:
a、int executeUpdate(String sql) throws SQLException
执行数据库的更新操作,返回更新的记录数;
b、ResultSet executeQuery(String sql) throws SQLException
执行数据库的查询操作,返回结果集对象;
c、void addBatch(String sql) throws SQLException
增加一个待执行的SQL语句;
d、int[] executeBatch() throws SQLException
批量执行SQL语句;
e、void closed() throws SQLException
关闭Statement操作;
f、boolean] execute() throws SQLException
执行SQL语句;
3、处理大数据对象,用PreparedStatement接口;
调用存储过程用CallableStatement接口;
事务处理;
使用元数据处理数据库;
!!!日后深入学习