日期:2014-05-20  浏览次数:53180 次

数据库问题java.sql.SQLException: Column not found,急!!!!
救命啊
我读不了数据库啊
各位大侠教教我~~

我的代码:
/*
  *   Main.java
  *
  *   Created   on   2007年3月20日,   上午12:33
  *
  *   To   change   this   template,   choose   Tools   |   Template   Manager
  *   and   open   the   template   in   the   editor.
  */

package   managersystem;
import   java.sql.*;

/**
  *
  *   @author   Administrator
  */
public   class   Main   {


       
        /**   Creates   a   new   instance   of   Main   */
        public   Main()   {
        }
       
        /**
          *   @param   args   the   command   line   arguments
          */
        public   static   void   main(String   argv[])   {
                //   TODO   code   application   logic   here
          try{
                          Connection   con=null;
                          Statement   stmt=null;
                          ResultSet   rs=null;
                         
                          Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ");
           
                          String   url   =   "jdbc:odbc:students ";
                         
                          con   =   DriverManager.getConnection(url);
                         
                          stmt   =   con.createStatement();
                         
                          String   sqlstmt= "select   sno,   name,   birthday,   department "+ "   from   students   where   sex= '男 ' ";
                         
                          rs   =   stmt.executeQuery   (sqlstmt);
                         
                          System.out.println( "-----------查询结果----------- ");
                          System.out.println();