try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e1)
{
System.out.println(e1.getMessage());
}
try
{
Connection con=DriverManager.getConnection("jdbc:odbc:yuli");
Statement sql=con.createStatement();
String str1=tde1.getText().trim();
String str2=tde2.getText().trim();
System.out.println("111");
ResultSet rs=sql.executeQuery("select 借入时间,还入时间,备注 from shujubiao where 借阅者='str1' and 电影名称='str2'");
System.out.println("222");
if(!rs.equals(null))
{
rs.first();
tde3.setText(rs.getString("借入时间"));
tde4.setText(rs.getString("还入时间"));
tde5.setText(rs.getString("备注"));}
pack();
con.close();
}
catch(SQLException e2)
{
System.out.println(e2.getMessage());
}我上面的方法里怎么得不到呢,错在那里呢?
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e1)
{
System.out.println(e1.getMessage());
}
try
{
Connection con=DriverManager.getConnection("jdbc:odbc:yuli");
Statement sql=con.createStatement();
String str1=tde1.getText().trim();
String str2=tde2.getText().trim();
System.out.println("111");
ResultSet rs=sql.executeQuery("select 借入时间,还入时间,备注 from shujubiao where 借阅者='str1' and 电影名称='str2'");
System.out.println("222");
if(!rs.equals(null))
{
rs.first();
tde3.setText(rs.getString("借入时间"));
tde4.setText(rs.getString("还入时间"));
tde5.setText(rs.getString("备注"));}
pack();
con.close();
}
catch(SQLException e2)
{
System.out.println(e2.getMessage());
}我上面的方法里怎么得不到呢,错在那里呢?
解决方案 »
- java如何读写excel2010(xlsx文件)
- 如何防止A、B同时提交时,出现的数据覆盖问题?
- 大家说说 java5 对自己目前的工作有什么实际上的帮助没有
- 求 thinking in java 课后答案Thinking in Java 3rd Ed. Annotated Solution Guide文档
- 重写一个JTable遇到的问题,请高手指教一二,挺急的
- runtime 如何隐藏CMD窗口
- 找工作的留意拉,某公司JAVA笔试题
- 一个简单类设计问题
- 我的RESIN-1.3.B1怎么不能运行了?
- java 日期数字格式化
- int j=5;j=j++ +1,j的值等于多少?
- 我调用它的时候传进的参数类型是不定的,我怎么做才能把传经去的类型转化为原来的类型呢?
{
tde3.setText(rs.getString("借入时间"));
tde4.setText(rs.getString("还入时间"));
tde5.setText(rs.getString("备注"));}