数据库查不出来 Connection connection;
Connection connection1=null;
Connection connection2=null;
PreparedStatement statement;
PreparedStatement statement1=null;
PreparedStatement statement2=null;
Statement stmt;
Statement stmt1;
ResultSet result;
ResultSet rs=null;
ResultSet rs2=null;
下面能查的出来
try
{
connection1=DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=F:\\javachat\\chat.mdb");
String sql="select ID from user where ID='"+str[1]+"' and PWD='"+str[2]+"'";
statement1=connection1.prepareStatement(sql);
rs=statement1.executeQuery();下面就查不出来了 靠 不明白(搞了我好几个小时,搞不定)
statement1.close();
connection1.close();
rs.close();
if (flag==1)
{
System.out.println("查询"+str[1]+"的好友");
connection2=DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=F:\\javachat\\chat.mdb"); String mysql="select * from ufd where ID='"+str[1]+"'";
statement2=connection2.prepareStatement(mysql);
rs2=statement2.executeQuery();
Connection connection1=null;
Connection connection2=null;
PreparedStatement statement;
PreparedStatement statement1=null;
PreparedStatement statement2=null;
Statement stmt;
Statement stmt1;
ResultSet result;
ResultSet rs=null;
ResultSet rs2=null;
下面能查的出来
try
{
connection1=DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=F:\\javachat\\chat.mdb");
String sql="select ID from user where ID='"+str[1]+"' and PWD='"+str[2]+"'";
statement1=connection1.prepareStatement(sql);
rs=statement1.executeQuery();下面就查不出来了 靠 不明白(搞了我好几个小时,搞不定)
statement1.close();
connection1.close();
rs.close();
if (flag==1)
{
System.out.println("查询"+str[1]+"的好友");
connection2=DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=F:\\javachat\\chat.mdb"); String mysql="select * from ufd where ID='"+str[1]+"'";
statement2=connection2.prepareStatement(mysql);
rs2=statement2.executeQuery();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货