Statement st=conn.createStatement();
String sql="select * from Test where id='"+id+"'";
try{
ResultSet result=st.executeQuery(sql);
String name=result.getString("name");
System.out.println(st.getConnection().toString());
result.close();
st.close();
return name;
}catch(Exception e){
System.out.println(e);
}
3 个解决方案
#1
贴出你的异常信息
#2
while(result.next()){
String name=result.getString("name");
}
String name=result.getString("name");
}
#3
to rui888
问题解决了,谢谢
问题解决了,谢谢
#1
贴出你的异常信息
#2
while(result.next()){
String name=result.getString("name");
}
String name=result.getString("name");
}
#3
to rui888
问题解决了,谢谢
问题解决了,谢谢