I've been researching this problem for days and have decided to ask this question here to see if anyone can help point me in the right direction.
I'm trying to populate combo boxes in my Netbeans 8.0.2 program with data from an MS Access 2013 table.
I'm using the most recent "Ucanaccess" with all of its necessary components to get the connection between the two, and from what I can tell the connection is good. However, when I run the program, it pops up an error exception message, reading:
net.ucanaccess.jdbc.UcanaccessSQLException: feature not supported
And that's it - no other letters, characters, numbers... nothing.
I'm honestly lost. Does anyone have any idea why I might be receiving this exception message?
Also, I'm running this on a Mac, however I use parallels and am actually running it on Microsoft Windows 7 virtual platform. It hasn't given me any trouble at all since then. 64 bit.
Here's what 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] from [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
at net.ucanaccess.jdbc.UcanaccessStatement.executeQuery(UcanaccessStatement.java:202)
at NewJFrame.FillCombo(NewJFrame.java:26)
at NewJFrame.<init>(NewJFrame.java:50)
at NewJFrame$2.run(NewJFrame.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.sql.SQLFeatureNotSupportedException: feature not supported
at org.hsqldb.jdbc.JDBCUtil.notSupported(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.executeQuery(Unknown Source)
at net.ucanaccess.jdbc.UcanaccessStatement.executeQuery(UcanaccessStatement.java:199)
... 17 more
You need to call PreparedStatement#executeQuery()
not PreparedStatement#executeQuery(String)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With