Professional Documents
Culture Documents
}
Adaugare credite
}
//actiune RESET
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
ID.setText("");
Nume_Curs.setText("");
Nr_Credit.setText("");
Cod_credit.setText("");
mesaj.setText(" ");
}
UPDATE
Connection dB=null;
int int1=Integer.parseInt(s1);
String url =
"jdbc:derby://localhost:1527/Test_curs_2020;create=true;user=student;password=Parola@RD!@";
// jdbc Connection
try
Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
//Get a connection
conn = DriverManager.getConnection(url);
{ except.printStackTrace(); }
try
{ stmt = conn.createStatement();
stmt.close(); }
{ sqlExcept.printStackTrace(); }
ID.setText("");
Nume_Curs.setText("");
Nr_Credit.setText("");
cod_credit.setText("");
//mesaj.setText("");
}
AFISARE
try
{
Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
//Get a connection
conn = DriverManager.getConnection(url);
}
catch (Exception except)
{
except.printStackTrace();
}
try{
int int1=0;
String s1=new String();
s1=this.ID.getText();
int1=Integer.parseInt(s1);
conn = DriverManager.getConnection(url);
}
catch(SQLException e)
{
JOptionPane.showMessageDialog(rootPane, e.toString(),"Error 1111...",
JOptionPane.INFORMATION_MESSAGE);
}
}
STERGERE dupa ID curs