你要到微软网站下载classes111.jar

解决方案 »

  1.   

    dburl="jdbc:microsoft:sqlserver://lmx:1433;DatabaseName=client";换成dburl="jdbc:microsoft:sqlserver://lmx";试一下
      

  2.   

    com.microsoft.jdbc.sqlserver.SQLServerDriver
      

  3.   

    错误提示socket连接不能成功,程序里url写的没错的话(再检查一下),到服务器上找找原因吧
    lmx机器上sql server服务启了吗?
    lmx上SqlServer Driver for Java安装完全了吗?

      

  4.   

    谢谢各位,好像还和sql server2000的版本有关,我用的是开发人员版,好像一直不行明年;联不上,用企业版就可以呢,不知道大家试过没有!
      

  5.   

    可以和sun1979song交给朋友吗,我的qq:30736588
    邮箱:[email protected]
    欢迎大家联系,探讨java
      

  6.   

    import java.util.*;
    import java.sql.*;
    import weblogic.jdbc.mssqlserver4.Driver;
    public class sqlTest
    {
    public sqlTest(){} public static void main(String[] args)
    {   
        Connection conn = null;
        Statement  stmt = null;
        
    try
    {
    Class.forName("weblogic.jdbc.mssqlserver4.Driver");
        System.out.println("Driver is ok.....");
    }
    catch(ClassNotFoundException e)
    {
    }
      
       
       
        try
        {
            conn = DriverManager.getConnection("jdbc:weblogic:mssqlserver4:buinfo@localhost:3014","lyw","3645202");
                System.out.println("conn is ok...");
        }
    catch(SQLException e)
            {
                System.out.println("conn error..."+e.toString());
            }
            
            
            
    try
    {
      
            stmt=conn.createStatement();
            java.sql.ResultSet rs = stmt.executeQuery("select * from usergroup");
            if(rs.next())
            {
                System.out.println("search is ok....");
            }
            else
            {
                System.out.println("search is not ok...");
            }
            rs.close();
    }
            catch(SQLException e)
            {
                System.out.println(e.toString());
            }
            
            try
            {
                stmt.close();
                conn.close();
            }
            catch(SQLException e)
            {
            }
         }
     }     
     //when it run : 
    Driver is ok.....
    conn error...java.sql.SQLException: java.sql.SQLException: $$$$$$$$$$$$$$$$ Lice
    nse Exception $$$$$$$$$$$$$$$$
    Missing license file for: WebLogic Server 6.1
    $$$$$$$$$$$$$$$$ License Exception $$$$$$$$$$$$$$$$Exception in thread "main" java.lang.NullPointerException
            at sqlTest.main(sqlTest.java:42)
    Press any key to continue...
    是驱动的问题
    还是驱动的问题
      

  7.   

    前段时间有人也有这种情况
    先用sql server manager去连接数据库看看 如果连不上  就是你
    的数据库tcp/ip远程监听没弄上!以前的兄弟在重装数据库后就可以了!:)