数据库访问接口.pptVIP

  • 8
  • 0
  • 约1.53万字
  • 约 112页
  • 2022-09-21 发布于广东
  • 举报
建立与数据库之间的连接,也就是创建一个Connection的实例。 DriverManager类的getConnection()方法将建立数据库的连接: public static Connection getConnection(String url, String user, String password) throws SQLException 在程序的最后,应该关闭Connection对象: public void close() throws SQLException 不同的驱动有不同的URL写法,如SQL Server下的URL: jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=xx 第62页,共112页。 使用Connection接口的方法 public void commit() throws SQLException public Statement createStatement() throws SQLException public boolean getAutoCommit() throws SQLException public CallableStatement prepareCall(String sql) throws SQLException 第63页,共1

文档评论(0)

1亿VIP精品文档

相关文档