Faustina Angelina

Greenhorn
+ Follow
since Jun 25, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Faustina Angelina

somashaker goud wrote:check your insert query . Actually I worked in oracle, where we wont use SET in insert instead SET will be used in update query.

you mean SET should be delete?
3 years ago
private void jButton_saveActionPerformed(java.awt.event.ActionEvent evt) {                                            
       // TODO add your handling code here:
       String nama =jTextField_nama.getText();
       String nik =jTextField_nik.getText();
       String ip =jTextField_ip.getText();
       String shift =jTextField_shift.getText();
       String div =jTextField_div.getText();
       String uk =jTextField_uk.getText();
       String pic =jTextField_pic.getText();
       Date tanggal =jDateChooser1.getDate();
       String jam =jTextField_jamrsk.getText();
       String mslh =jTextField_masalah.getText();
       String analisa =jTextField_analisa.getText();
       String tindakan =jTextField_tindakan.getText();
       String rekom =jTextField_rekomen.getText();
       String part =jTextField_part.getText();
       Date lapor =jDateChooser2.getDate();
       Date mulai =jDateChooser3.getDate();
       Date bar =jDateChooser4.getDate();
       String total =jTextField_total.getText();
       String laporkan =jTextField_laporkan.getText();
       String kerjakan =jTextField_perbaiki.getText();
       
       openDB();
       try {
          stm = con.createStatement();
          stm.executeUpdate("insert into kerusakan  set nama='"+nama+"'"
                   + ",nik='"+nik+"'"
                   + ",pic='"+pic+"'"
                   + ",ip='"+ip+"'"
                   + ",shift='"+shift+"'"        
                   + ",div='"+div+"'"
                   + ",unitkerja='"+uk+"'"
                   + ",masalah='"+mslh+"'"
                   + ",analisa='"+analisa+"'"
                   + ",tindakan='"+tindakan+"'"
                   + ",rekomen='"+rekom+"'"
                   + ",part='"+part+"'"
                   + ",lapor='"+lapor+"'"
                   + ",laporkan='"+laporkan+"'"
                   + ",mulai='"+mulai+"'"
                   + ",bar='"+bar+"'"
                   + ",kerjakan='"+kerjakan+"'"
                   + ",tanggal='"+tanggal+"'"
                   + ",jam='"+jam+"'"
                   + ",total='"+total+"'");
                   
          JOptionPane.showMessageDialog(this, "Berhasil", "Pesan",
                  JOptionPane.INFORMATION_MESSAGE);
          } catch (SQLException e) {
            System.out.println(""+e);
         JOptionPane.showMessageDialog(this,"Gagal Menyimpan Data\n"+e,
                    "Pesan Error", JOptionPane.ERROR_MESSAGE);
       jTabbedPane2.setSelectedIndex(2);
   }                                            
   }

ERROR :
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div='TCT',unitkerja='PRODUCTION',masalah='',analisa='',tindakan='',rekomen='',pa' at line 1
3 years ago