我需要从我的数据库中获取数据这里是我获取数据的代码
Connect.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view){
try{
Connection con = connectionClass.CONN();
String query = "SELECT * FROM Driver WHERE UID='" + UID + "'";
Statement stmt = con.prepareStatement(query);
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
UDI = rs.getString("FirstName");
TextView Name = (TextView) findViewById(R.id.name);
Name.setText(UDI);
}
}
catch (Exception ex)
{
}
}
});
问题是,每当我点击按钮时,都没有提取任何内容。