可能是木那个字段  例如:
 select a.name,b.ds  from tab a,tab b

解决方案 »

  1.   

    代码如下:
    package com.qiu.jdbc;
    import java.net.*;
    import java.sql.*;public class select { /**
     * @param args
     */
    public static void main(String[] args) {
    String l="jdbc:odbc:test";
    try{
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    }
    catch(ClassNotFoundException e){
    System.out.println("ClassNotFountException: ");
    System.err.println(e.getMessage());
    }
    Connection con=DriverManager.getConnection(l,"sa","");
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery("select * from USER1 ");
    while(rs.next()){
    for(int i=0;i<=3;i++)
    System.out.println("这是第"+i+"个字符的内容"+rs.getString(i));
    }
    con.close();
    }
    catch(SQLException e){
    while(e!=null){
    System.out.println("数据库异常被捕获");
    System.out.println(e.getMessage());
    System.out.println(e.getErrorCode());
    e=e.getNextException();
    }
    }
    }
    }
      

  2.   

    这个测试连接的就可以用
    package com.qiu.jdbc;
    import java.net.URL;
    import java.sql.*;public class test { /**
     * @param args
     */
    public static void main(String[] args) {
    String l="jdbc:odbc:test";
    try{
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    }
    catch(java.lang.ClassNotFoundException e){
    System.out.print("ClassNotFoundException:");
    System.err.print(e.getMessage());
    }
    Connection con=DriverManager.getConnection(l,"sa"," ");
    DatabaseMetaData dma=con.getMetaData();
    System.out.println("连接的数据库:"+dma.getURL());
    System.out.println("Driver :"+dma.getDriverName());
    System.out.println("Vension :"+dma.getDriverVersion());
    con.close();
    }

    catch(SQLException e){
    while(e!=null){
    System.out.println("数据库异常被捕获了");
    System.out.println(e.getSQLState());
    System.out.println(e.getMessage());
    System.out.println(e.getErrorCode());
    e=e.getNextException();
    }
    }
    }
    }
      

  3.   

    有user这个表的.
    问下 用sqlserver2000 是不是一定要装补丁sp3的
      

  4.   

    建议你先在sqlserver2000试一下你的那句SQL语句,看看是否能执行
      

  5.   

    那句sql 语句可以执行的
      

  6.   

    1. Connection con=DriverManager.getConnection(l,"sa","");
       Connection con=DriverManager.getConnection(l,"sa"," ");
    The password is empty or one space?2. You may need a database name before USER1, sth. like [MEMBER].[SA].USER1.
    Or you should add the database name in your connection url.