日期:2014-05-20 浏览次数:20547 次
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");} catch(ClassNotFoundException event){System.out.println(""+event);} try{ con=DriverManager.getConnection("jdbc:odbc:lpf", strUserId,strPassword); sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); rs=sql.executeQuery("select * from dstudent where sno='"+jTextField1.getText()+"'"); catch(SQLException ee){ JOptionPane.showMessageDialog(this, "学号不存在或输入错误", "错误", JOptionPane.WARNING_MESSAGE); System.out.println(ee); }
------解决方案--------------------
Java codetry { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}
catch(ClassNotFoundException event){System.out.println(""+event);}
try{con=DriverManager.getConnection("jdbc:odbc:lpf", strUserId,strPassword);
sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs=sql.executeQuery("select * from dstudent where sno='"+jTextField1.getText()+"'");
catch(SQLException ee)
{ JOptionPane.showMessageDialog(this, "学号不存在或输入错误", "错误", JOptionPane.WARNING_MESSAGE);
System.out.println(ee); }
------解决方案--------------------
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");} catch(ClassNotFoundException event){System.out.println(""+event);} try{con=DriverManager.getConnection("jdbc:odbc:lpf", strUserId,strPassword); sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); rs=sql.executeQuery("select * from dstudent where sno='"+jTextField1.getText()+"'"); catch(SQLException ee) { JOptionPane.showMessageDialog(this, "学号不存在或输入错误", "错误", JOptionPane.WARNING_MESSAGE); System.out.println(ee); }
------解决方案--------------------
不错。
------解决方案--------------------
好东西
------解决方案--------------------
阿尔法而发而发而发而发而发而发而未发而为
------解决方案--------------------
好东西学习了
------解决方案--------------------