Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[ASK]Bugs of Java or Wrong Code?

1028639Jul 27 2013 — edited Jul 30 2013

Dear All,

What this is bugs of Java or me not to understand java programming, this my piece code :

String kode = txtKode.getText();

        String nama = inputNama.getText();

        String keterangan = inputKeterangan.getText();

      

        try {

            Connection c = KoneksiMySql.getKoneksi();

            String sql = "UPDATE UNIT SET NAMA=?, KETERANGAN=?, WKT_INPUT=now() WHERE KODE=?";

            PreparedStatement p = c.prepareStatement(sql);

          

            p.setString(1, nama);

            p.setString(2, keterangan);

            p.setString(3, kode);

          

            p.executeUpdate();

            p.close();

            JOptionPane.showMessageDialog(null, "Data Berubah",

                    "Pemberitahuan", JOptionPane.INFORMATION_MESSAGE);

        } catch(SQLException e) {

            System.out.println("Error : " + e);

            JOptionPane.showMessageDialog(null, "Proses Rubah Unit Gagal",

                    "Pesan Error", JOptionPane.ERROR_MESSAGE);      

        }finally {

        inputNama.setText(null);

        inputKeterangan.setText(null);

            btnTambah.setEnable(true);

            btnHapus.setEnabled(false);

            btnRubah.setEnabled(false);

            inputNama.requestFocus();

        }

JOptionPane is Show and no error appears but data in database does not change, and code in block finally not executed.

i'm use jInternalFrame, first run Only 'Add Button, Search Button' enable and other button are disable, then when 'Search Button' is clicked and open other jInternalFrame and get data form database, 'Add button' Disable and 'Delete Button, Change Button' are Enable. that my piece code on Change Button ActionPerformed.

Please it's support.

Thanks,

Best & Regrads.

Comments

Alex Keh-Oracle

Normally, I would recommend backing out the patch on the server or client or both, whichever causes the error. Since this is a CPU, the preferred solution is to diagnose the root cause and fix it. The problem itself may not be due to ODP.NET. It could some issue with the Oracle Client or DB server that the patch changed. I would recommend opening up an Oracle SR and working with Support to diagnose the issue, Oracle then should be able to provide you a workaround or fix to resolve it.

799292

Thank you for your answers.

I have created now a service request.

Number is SR 3-17672759281
(I am not able to paste copied things into this application!)

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 27 2013
Added on Jul 27 2013
3 comments
1,962 views