这和JDBC连接SQL Server的程序非常相似。只是协议不同而已。很多Java、J2EE服务器端编程书籍都有介绍。

解决方案 »

  1.   

     下面的例子是用于MYSQL,我想SQL Server和它大体一样. 
    你先下载MYSQL和它的JDBC驱动程序,按下面的配置走一遍.(肯定没问题) 
    成功后再做SQL Server,就会轻车熟路了! 
    俺也没SQL Server的JdBC驱动程序,所以也没法试! 1) Go to JDBC Explorer and select  "View | Options" from the menu. Click on 
    the "Drivers" tab and then Click on the "Add" button. Key in the MySQL driver name (I use the one from Mark Mathews): 
       org.gjt.mm.mysql.Driver and press OK. You can enter a sample URL if you like e.g. 
       mysql://localhost/databasename 2) Go back to JBuilder. 
       Click on the "Tools | Enterprise Setup" menu option. 
       Click on the "Database Drivers" tab and the click on the "Add" button. 
       On the "Select One or More Libraries" dialog click on the "New.." button 
       Enter the MySQL driver name in the "Name" field i.e. 
           org.gjt.mm.mysql.Driver 
       Then click on the "Add" button for Library paths and search/select the 
    MySQL driver jar file and click "OK" button: 
           mm.mysql.jdbc-1.2b 
       Then go back through the panels click on "OK". I think you should then find that the driver is available for you to use. 3) When you setup a new connection module the MySQL jdbc driver should now 
    be available and if you set up a "sample URL" in JDBC explorer you should 
    just have to overtype the database/password details to get it working 语句用
     Class.forName(DriveName);
     Connection conn = DriverManager.getConnection(url,username,password);
      

  2.   

    For example:dbdriver=interbase.interclient.Driverdbserver=jdbc:interbase://192.168.1.240/c:/initDb/InterBase/vdbib.gdbThen u can use JDBC API to connect to InterbaseAny problems, contact me.Y do you use InterBase? Y not MySQL ...?
      

  3.   

    public int getCount(String sqlstr)
    {
    int count = -1;
            Connection con = null;
            Statement stmt = null;
            try {
            con = myBroker.getConnection();
    stmt = con.createStatement(); 
    ResultSet results = stmt.executeQuery(sqlstr); 
    ResultSetMetaData rsmd = results.getMetaData();
                 results.next();
    count = Integer.parseInt(results.getString(1));
    results.close();
    }
    catch (Exception e)
    {
    ;
    }
    finally {
    try{
         if(stmt != null){
         stmt.close();
         }
         }catch(SQLException e1){};
                 }
    // The connection is returned to the Broker
    myBroker.freeConnection(con);
    return count;
    }
      

  4.   

    我下载了两个连接Interbase 的JDBC驱动程序interclient,是通过http://www-900.ibm.com/cn/support/下载的,可就是都不能安装成功,通过自带的帮助发现
    ClassPath没有改变,但是可供改变ClassPath的文件InterClient。jar又没有在解压后的文件夹下找到,可能是下载不完整吧。请问该怎么办。我没装JDK,我是通过访问另外一台机子。
      

  5.   

    Go to Borland web site, download again. contack me at [email protected], if you still can't solve the problem. Good luck