java - Ucanaccess SQL Exception: feature not supported (Access and Netbeans) -
i've been researching problem days , have decided ask question here see if can point me in right direction.
i'm trying populate combo boxes in netbeans 8.0.2 program data ms access 2013 table.
i'm using recent "ucanaccess" of necessary components connection between two, , can tell connection good. however, when run program, pops error exception message, reading:
net.ucanaccess.jdbc.ucanaccesssqlexception: feature not supported
and that's - no other letters, characters, numbers... nothing.
i'm lost. have idea why might receiving exception message?
also, i'm running on mac, use parallels , running on microsoft windows 7 virtual platform. hasn't given me trouble @ since then. 64 bit.
here's i've got coded.
import java.sql.*; import javax.swing.*; public class newjframe extends javax.swing.jframe { connection conn = null; resultset rs = null; preparedstatement pst = null; private void fillcombo() { string sql = "select [description] [doors]"; try { string driver = "net.ucanaccess.jdbc.ucanaccessdriver"; class.forname(driver); conn = drivermanager.getconnection("jdbc:ucanaccess://c:/test/db.accdb"); pst = conn.preparestatement(sql); rs = pst.executequery(sql); while (rs.next()) { string nme = rs.getstring("description"); cmb1.additem(nme); } conn.close(); } catch (exception e) { joptionpane.showmessagedialog(null,e); } } /** * creates new form newjframe */ public newjframe() { initcomponents(); fillcombo(); }
updated:
net.ucanaccess.jdbc.ucanaccesssqlexception: feature not supported @ net.ucanaccess.jdbc.ucanaccessstatement.executequery(ucanaccessstatement.java:202) @ newjframe.fillcombo(newjframe.java:26) @ newjframe.<init>(newjframe.java:50) @ newjframe$2.run(newjframe.java:117) @ java.awt.event.invocationevent.dispatch(invocationevent.java:311) @ java.awt.eventqueue.dispatcheventimpl(eventqueue.java:756) @ java.awt.eventqueue.access$500(eventqueue.java:97) @ java.awt.eventqueue$3.run(eventqueue.java:709) @ java.awt.eventqueue$3.run(eventqueue.java:703) @ java.security.accesscontroller.doprivileged(native method) @ java.security.protectiondomain$1.dointersectionprivilege(protectiondomain.java:75) @ java.awt.eventqueue.dispatchevent(eventqueue.java:726) @ java.awt.eventdispatchthread.pumponeeventforfilters(eventdispatchthread.java:201) @ java.awt.eventdispatchthread.pumpeventsforfilter(eventdispatchthread.java:116) @ java.awt.eventdispatchthread.pumpeventsforhierarchy(eventdispatchthread.java:105) @ java.awt.eventdispatchthread.pumpevents(eventdispatchthread.java:101) @ java.awt.eventdispatchthread.pumpevents(eventdispatchthread.java:93) @ java.awt.eventdispatchthread.run(eventdispatchthread.java:82) caused by: java.sql.sqlfeaturenotsupportedexception: feature not supported @ org.hsqldb.jdbc.jdbcutil.notsupported(unknown source) @ org.hsqldb.jdbc.jdbcpreparedstatement.executequery(unknown source) @ net.ucanaccess.jdbc.ucanaccessstatement.executequery(ucanaccessstatement.java:199) ... 17 more
you need call preparedstatement#executequery()
not preparedstatement#executequery(string)
Comments
Post a Comment