private boolean existsDescriptor(String descriptor) throws java.sql.SQLException
{
String sqlStatement = "SELECT descriptor_id FROM descriptors WHERE descriptor_name = \"" + descriptor + "\"";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sqlStatement);
if(rs.next())
{
System.out.println (rs.getInt(1));
System.out.println (rs.getString(1));
rs.close();
stmt.close();
return true;
}
rs.close();
stmt.close();
return false;
}
|