是写成application还是jsp?? 很简单的,自己动手吧

解决方案 »

  1.   

    dos环境模拟流程大概是这样的    try{
          int count = 0;
          BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
          while( count < 3 ){
            if( br.readLine().equals( "mypw" ) ){
              System.out.println("pw right");
              break;
            }else{
              System.out.println( "pw wrong" );
            }
            count++;
          }
        }catch( Exception e ){
        }
      

  2.   

    呵呵
    还是把分给我好了
    来抢分了
    package codewindows;
    import java.net.URL;
    import java.sql.*;//数据库连接文件public class Search {
      private String url;
      String name ="";
      String password = "";
      private Connection connect;
      private Statement statement;
      private ResultSet result;  public Search(String aaaa) {
        WindowsFrame frame1 = new WindowsFrame();
        name = aaaa;
        try{
          Class.forName("org.gjt.mm.mysql.Driver");
          url = "jdbc:mysql://localhost/mytimetable?useUnicode=true&characterEncoding=gb2312";
          connect = DriverManager.getConnection(url,"","");
          statement = connect.createStatement();
          String query = "SELECT PASSWARD FROM 你的表的名称 WHERE NAME="+password;
          result = statement.executeQuery(query);
          while(result.next())
          {
          password = result.getString(1);
          }
          result.close();
          statement.close();
          connect.close();
          }
          catch(ClassNotFoundException cnfex){
            cnfex.printStackTrace();
          }
          catch(SQLException sqlex){
            sqlex.printStackTrace();
          }
      }
    }
      

  3.   

    你看看nodreamer(无梦) 的,它都告诉你数据库的连接知识了!
    我给你ACCESS的连接!我给你贴上!得给分呀!哈哈1
    import java.sql.*;public class JDBCAccess
    {
    public static void main(String[] args)
    {
      String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
      String fileName="TestDB.mdb";
    String url = "jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ="+fileName;
        System.out.println(url);
        try
        {
          Class.forName(driver);
          Connection conn = DriverManager.getConnection(url, "", "");
          Statement stmt=conn.createStatement();
          String sql="select * from table1";
          ResultSet rs=stmt.executeQuery(sql);
          while(rs.next())
          {
           System.out.println(rs.getString("test1"));
          }
        }
        catch(ClassNotFoundException cnfe) {
         System.out.println(cnfe);
          //throw new Exception("不能找到Access数据库的驱动程序 ");
        }
        catch (SQLException sqle)
        {
         System.out.println(sqle);
          //throw new SQLException("不能连接到Access数据库 ");
        }
    }
    }