回覆列表
  • 1 # 使用者9147460208505

    可以用下面的辦法:

    1.裝載Oracle自帶的Java包;

    2.裝載MSSQL的JDBC驅動(或第三方的驅動);

    3.在Java儲存過程中呼叫,如下:

    Connection conn = null;

    Statement stmt = null;

    String strUser="user";

    String strPass="pass";

    String strDbname ="DB_demo";

    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver";

    String url="jdbc:microsoft:sqlserver://10.1xx.1xx.x:1433";

    conn= DriverManager.getConnection(url,strUser,strPass);

    conn.setCatalog( strDbname );

    stmt = conn.createStatement();

    String strSql = "Select .......";

    ResultSet rs = stmt.executeQuery(strSql);

    stmt.close();

    conn.close();

  • 中秋節和大豐收的關聯?
  • 住院收費票據丟失怎麼辦?