My problem is , while opening a jframe which is including different informations than my main jframe , when i tried to work on this jframe, for example inserting data to SQLite manager's database . But it's giving me Database locked error.I can insert data from my main jframe which i'm opening new jframes with jcombobox. I hink i know source but i dont know how to fix this. I think i need to close my main jframe which i open other frames. So sqlite database can storage this frames datas. Here i'll give to you how can i open jframes with jcombobox and how i'm trying to insert a data to database. Please help me or , leave a comment what're you thinking about this problem. Am i wrong with source idea or true. I need your helps guys. Thanks for reading.
1: This codes how i'm opening jframes with combobox.
public void comboselect(){
int d =ComboBox_name.getSelectedIndex();
if (d==0){
Cezal?Uye s=new Cezal?Uye();
s.setVisible(true);
dispose();
}
if(d==1){
DeaktifUye z=new DeaktifUye();
z.setVisible(true);
dispose();
}
if(d==2){
TatbikatForm l=new TatbikatForm();
l.setVisible(true);
dispose();
}
}
2:This codes how i'm trying to insert data which i opened from jcombobox.
private void cmd_saveActionPerformed(java.awt.event.ActionEvent evt) {
try{
String sql = "Insert into cezalitablosu (KimTaraf?ndan,Kime,Neden,Ka??nc?,Tarih) values (?,?,?,?,?)";
pst=conn.prepareStatement(sql);
pst.setString(1, jTextField1.getText());
pst.setString(2, jTextField2.getText());
pst.setString(3, jTextField3.getText());
pst.setString(4, jTextField4.getText());
pst.setString(5, jTextField5.getText());
pst.execute();
JOptionPane.showMessageDialog(null, "Kaydedildi!");
}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null, e);
}
Update_table();
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…