Connection conn = null;
PrintWriter out = null;
PreparedStatement statement = null;
ResultSet rs = null;
try {
conn = new DBConnect().getConnect();
String strsql = "select * from mt_audit_zbz_table where zbz_id = ?";
statement =conn.prepareStatement(strsql);
statement.setString(1, uuid);
rs= statement.executeQuery();
while(rs.next()){
String table_id = rs.getString("table_id");
String data_year = rs.getString("data_year");
System.out.println("the fname is " + "table_id="+table_id+"data_year="+data_year);
}
}
catch (Exception e) {
log.error(e, e);
}finally{
try {
rs.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
statement.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}