Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Vegan;
- import java.sql.Connection;
- import java.sql.DriverManager;
- public class connectionString {
- static Connection connection = null;
- public static Connection getConnection()
- {
- try
- {
- connection = DriverManager.getConnection("jdbc:ucanaccess://C:/Mo//MyDatabase1.accdb");
- System.out.println("---connection succesful---");
- }
- catch (Exception ex)
- {
- System.out.println("Connection Unsuccesful");
- }
- return connection;
- }
- import java.sql.Connection;
- import java.sql.DriverManager;
- public class connectionString {
- static Connection connection = null;
- public static Connection getConnection()
- {
- try
- {
- connection = DriverManager.getConnection("jdbc:ucanaccess://C:/Mo//MyDatabase1.accdb");
- System.out.println("---connection succesful---");
- }
- catch (Exception ex)
- {
- System.out.println("Connection Unsuccesful");
- }
- return connection;
- }
- package Vegan;
- import static java.nio.file.Files.list;
- import static java.rmi.Naming.list;
- import java.sql.*;
- import java.util.ArrayList;
- import static java.util.Collections.list;
- import java.util.List;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import javax.swing.JComboBox;
- public class DB {
- private static ResultSet rs = null;
- private static PreparedStatement ps = null;
- private static Connection connection = null;
- private int StoreID;
- private String userID;
- public DB() {
- connection = connectionString.getConnection();
- }
- import static java.nio.file.Files.list;
- import static java.rmi.Naming.list;
- import java.sql.*;
- import java.util.ArrayList;
- import static java.util.Collections.list;
- import java.util.List;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import javax.swing.JComboBox;
- public class DB {
- private static ResultSet rs = null;
- private static PreparedStatement ps = null;
- private static Connection connection = null;
- private int StoreID;
- private String userID;
- public DB() {
- connection = connectionString.getConnection();
- }
- package Vegan;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import javax.swing.DefaultComboBoxModel;
- import net.proteanit.sql.DbUtils;
- public class UserMenu extends javax.swing.JFrame {
- /**
- * Creates new form UserMenu
- */
- public UserMenu() {
- try {
- initComponents();
- DB db = new DB();
- db.getCat(cmbCategory);
- } catch (SQLException ex) {
- Logger.getLogger(UserMenu.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import javax.swing.DefaultComboBoxModel;
- import net.proteanit.sql.DbUtils;
- public class UserMenu extends javax.swing.JFrame {
- /**
- * Creates new form UserMenu
- */
- public UserMenu() {
- try {
- initComponents();
- DB db = new DB();
- db.getCat(cmbCategory);
- } catch (SQLException ex) {
- Logger.getLogger(UserMenu.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- run:
- ---connection succesful---
- Sep 11, 2016 11:04:47 PM Vegan.UserMenu
- SEVERE: null
- net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.0.6 feature not supported
- at net.ucanaccess.jdbc.UcanaccessStatement.executeQuery(UcanaccessStatement.java:211)
- at Vegan.DB.getCat(DB.java:203)
- at Vegan.UserMenu.(UserMenu.java:28)
- at Vegan.UserMenu$4.run(UserMenu.java:179)
- at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
- at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749)
- at java.awt.EventQueue.access$500(EventQueue.java:97)
- at java.awt.EventQueue$3.run(EventQueue.java:702)
- at java.awt.EventQueue$3.run(EventQueue.java:696)
- at java.security.AccessController.doPrivileged(Native Method)
- at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
- at java.awt.EventQueue.dispatchEvent(EventQueue.java:719)
- 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:208)
- ... 17 more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement