Code: Select all
initComponents();
try{
Connection con=ConnectionProvider.getCon();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select count(id) from question");
if(rs.first())
{
int id=rs.getInt(1);
id=id+1;
String str=String.valueOf(id);
jLabel4.setText(str);
}
else
jLabel4.setText("1");
}
catch(Exception e)
{
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf, e);
}
}
Ich bin sehr neu in der Codierung von pls hilf