java.sql.SQLException: Driver does not support this function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

java.sql.SQLException: Driver does not support this function

Netbeans Indonesia mailing list
Dear all para master

kenpa syntax yang saya jalankan dibawah ini tidak bisa

                    Connection Con =null;
                    String fdata = jTextField1.getText() ;
                    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

                    //koneksi langsung ke database tanpa dsn
                    Con= DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" + fdata);
                   
         
                       
                       
                        String sql = "SELECT USER_ID, Tanggal, Masuk, Keluar "
                                + "FROM Data_Second;";
                       
                        PreparedStatement pst = Con.prepareStatement(sql);
                        ResultSet rs = pst.executeQuery(sql);
                       
                        while(rs.next()){
                            //lakukan penelusuran baris
                           
                            ModelKehadiran moda = new ModelKehadiran();
                           
                            moda.setIdpegawai(rs.getString("USER_ID"));
                            moda.setTanggal(rs.getDate("Tanggal"));
                            moda.setJmasuk(rs.getString("Masuk"));
                            moda.setJkeluar(rs.getString("Keluar"));
                           
                            ManajemenUploadData mana = new ManajemenUploadData();
                            mana.tambahKehadiran(moda);
                           
                        }
                        JOptionPane.showMessageDialog(rootPane, "Data berhasil ditambah", "Data berhasil ditambah",JOptionPane.INFORMATION_MESSAGE);
                 
                   
                }


dan mendapatkan error seperti dibawah ini.....udah google kesana kamri gk jg ketemu solusinya

run:
Jun 04, 2015 12:01:53 PM view.Admin uploadActionPerformed
SEVERE: null
java.sql.SQLException: Driver does not support this function
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPreparedStatement.java:116)
    at view.Admin.uploadActionPerformed(Admin.java:1766)
    at view.Admin.access$2100(Admin.java:53)
    at view.Admin$24.actionPerformed(Admin.java:918)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:708)
    at java.awt.EventQueue$4.run(EventQueue.java:706)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

BUILD STOPPED (total time: 2 minutes 8 seconds)

Reply | Threaded
Open this post in threaded view
|

Re: java.sql.SQLException: Driver does not support this function

Netbeans Indonesia mailing list
Sepertinya driver JDBC nya ga sesuai,
silahkan di cek dan disesuaikan dengan database dan system operasinya

terdeteksinya di sini "java.sql.SQLException: Driver does not support this
function"

On Thu, Jun 4, 2015 at 12:59 PM, abdul Hayyi [hidden email]
[netbeans-indonesia] <[hidden email]> wrote:

>
>
> Dear all para master
>
> kenpa syntax yang saya jalankan dibawah ini tidak bisa
>
>                     Connection Con =null;
>                     String fdata = jTextField1.getText() ;
>                     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>
>                     //koneksi langsung ke database tanpa dsn
>                     Con=
> DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver
> (*.mdb)};DBQ=" + fdata);
>
>
>
>
>                         String sql = "SELECT USER_ID, Tanggal, Masuk,
> Keluar "
>                                 + "FROM Data_Second;";
>
>                         PreparedStatement pst = Con.prepareStatement(sql);
>                         ResultSet rs = pst.executeQuery(sql);
>
>                         while(rs.next()){
>                             //lakukan penelusuran baris
>
>                             ModelKehadiran moda = new ModelKehadiran();
>
>                             moda.setIdpegawai(rs.getString("USER_ID"));
>                             moda.setTanggal(rs.getDate("Tanggal"));
>                             moda.setJmasuk(rs.getString("Masuk"));
>                             moda.setJkeluar(rs.getString("Keluar"));
>
>                             ManajemenUploadData mana = new
> ManajemenUploadData();
>                             mana.tambahKehadiran(moda);
>
>                         }
>                         JOptionPane.showMessageDialog(rootPane, "Data
> berhasil ditambah", "Data berhasil
> ditambah",JOptionPane.INFORMATION_MESSAGE);
>
>
>                 }
>
> dan mendapatkan error seperti dibawah ini.....udah google kesana kamri gk
> jg ketemu solusinya
>
> run:
> Jun 04, 2015 12:01:53 PM view.Admin uploadActionPerformed
> SEVERE: null
> java.sql.SQLException: Driver does not support this function
>     at
> sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPreparedStatement.java:116)
>     at view.Admin.uploadActionPerformed(Admin.java:1766)
>     at view.Admin.access$2100(Admin.java:53)
>     at view.Admin$24.actionPerformed(Admin.java:918)
>     at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
>     at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
>     at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
>     at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
>     at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
>     at java.awt.Component.processMouseEvent(Component.java:6516)
>     at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
>     at java.awt.Component.processEvent(Component.java:6281)
>     at java.awt.Container.processEvent(Container.java:2229)
>     at java.awt.Component.dispatchEventImpl(Component.java:4872)
>     at java.awt.Container.dispatchEventImpl(Container.java:2287)
>     at java.awt.Component.dispatchEvent(Component.java:4698)
>     at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
>     at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
>     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
>     at java.awt.Container.dispatchEventImpl(Container.java:2273)
>     at java.awt.Window.dispatchEventImpl(Window.java:2719)
>     at java.awt.Component.dispatchEvent(Component.java:4698)
>     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
>     at java.awt.EventQueue.access$200(EventQueue.java:103)
>     at java.awt.EventQueue$3.run(EventQueue.java:694)
>     at java.awt.EventQueue$3.run(EventQueue.java:692)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
>     at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
>     at java.awt.EventQueue$4.run(EventQueue.java:708)
>     at java.awt.EventQueue$4.run(EventQueue.java:706)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
>     at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
>     at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
>     at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
>     at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
>     at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
>     at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
>     at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
>
> BUILD STOPPED (total time: 2 minutes 8 seconds)
>
>  
>