一样的。faq 里看一下就知道了。

解决方案 »

  1.   

    Connecting to an Oracle Database
    This example uses an Oracle JDBC driver to connect to an Oracle database instance located at 128.0.0.0:1521 with an sid called mydatabase. 
        Connection connection = null;
        try {
            // Load the JDBC driver
            String driverName = "oracle.jdbc.driver.OracleDriver";
            Class.forName(driverName);
        
            // Create a connection to the database
            String serverName = "127.0.0.1";
            String portNumber = "1521";
            String sid = "mydatabase";
            String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
            String username = "username";
            String password = "password";
            connection = DriverManager.getConnection(url, username, password);
        } catch (ClassNotFoundException e) {
            // Could not find the database driver
        } catch (SQLException e) {
            // Could not connect to the database
        }Connecting to a MySQL Database
    This example connects to a MySQL database using the MM JDBC driver for MySQL. You need to have an account in MySQL database to run this example. To create an account, you can connect to MySQL database on your platform as root, and run the following command: 
        mysql> GRANT ALL PRIVILEGES ON *.* TO username@localhost
        IDENTIFIED BY 'password' WITH GRANT OPTION;
            Connection connection = null;
        try {
            // Load the JDBC driver
            String driverName = "org.gjt.mm.mysql.Driver"; // MySQL MM JDBC driver
            Class.forName(driverName);
        
            // Create a connection to the database
            String serverName = "localhost";
            String mydatabase = "mydatabase";
            String url = "jdbc:mysql://" + serverName +  "/" + mydatabase; // a JDBC url
            String username = "username";
            String password = "password";
            connection = DriverManager.getConnection(url, username, password);
        } catch (ClassNotFoundException e) {
            // Could not find the database driver
        } catch (SQLException e) {
            // Could not connect to the database
        }Connecting to a SQLServer Database
    This example connects to a SQLServer database using the NetDirect JDBC driver. For information about this driver, see e232 Getting JDBC Drivers for a Database. 
        Connection connection = null;
        try {
            String driverName = "com.jnetdirect.jsql.JSQLDriver"; // NetDirect JDBC driver
            String serverName = "127.0.0.1";
            String portNumber = "1433";
            String mydatabase = serverName + ":" + portNumber;
            String url = "jdbc:JSQLConnect://" + mydatabase; // a JDBC url
            String username = "username";
            String password = "password";
        
            // Load the JDBC driver
            Class.forName(driverName);
        
            // Create a connection to the database
            connection = DriverManager.getConnection(url, username, password);
        } catch (ClassNotFoundException e) {
            // Could not find the database driver
        } catch (SQLException e) {
            // Could not connect to the database
        }
      

  2.   

    我下载了MS SQLServer 2000 的JDBC,如何在JBuilder里配置,
    配合 Keepers(中文昵称) 的代码使用呢?或者,不在JBuilder里,怎么配置JDBC?
    好像不用JDBC-ODBC桥就可以?
     Keepers(中文昵称) 的代码里,连接SQL Server用的是什么?
    谢谢着急中
      

  3.   

    如果不在jb中,那么就直接放在你的java-home/jre/lib/ext/目录中就可以了
    如果在jb中,那么加到项目中引用就可以了
    我上边的帖子中有三种连接mysql\oracle\sqlserver,你一定没有仔细看。
    我把sql放在下边。
    Connecting to a SQLServer Database
    This example connects to a SQLServer database using the NetDirect JDBC driver. For information about this driver, see e232 Getting JDBC Drivers for a Database. 
        Connection connection = null;
        try {
            String driverName = "com.jnetdirect.jsql.JSQLDriver"; // NetDirect JDBC driver
            String serverName = "127.0.0.1";
            String portNumber = "1433";
            String mydatabase = serverName + ":" + portNumber;
            String url = "jdbc:JSQLConnect://" + mydatabase; // a JDBC url
            String username = "username";
            String password = "password";
        
            // Load the JDBC driver
            Class.forName(driverName);
        
            // Create a connection to the database
            connection = DriverManager.getConnection(url, username, password);
        } catch (ClassNotFoundException e) {
            // Could not find the database driver
        } catch (SQLException e) {
            // Could not connect to the database
        }