Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 (中文) » SQL Anywhere 服务器 - 编程 » JDBC 支持 » 从 JDBC 客户端应用程序连接 » 从服务器端的 JDBC 类建立连接

 

服务器端连接示例的不同之处

服务器端连接示例与客户端连接示例几乎是相同的,但有以下几个例外:

  1. 不需要装载 JDBC 驱动程序。本示例中删除了 DriverManager.registerDriver 和 Class.forName 的调用。

  2. 它使用当前连接与缺省的运行数据库建立连接。已将 getConnection 调用中的 URL 更改为:

    Connection con = DriverManager.getConnection(
              "jdbc:default:connection" );
  3. System.exit() 语句已删除。