Net.ucanaccess.jdbc.UcanaccessSQLException: Invalid Authorization Specification - Not Found:

I'm trying to populate a table from a database using ucanacces, but it gives me the following error and I don't understand why, when going through this error, most people mention something about username and password, but I don't see how relevant it is. as I am not using username and password throughout the application.

Error (this is a complete error, I don't know why it ends after: :):

net.ucanaccess.jdbc.UcanaccessSQLException: invalid authorization specification - not found: 

      

code:

final static String DBPAD = "src/Attachments/Database SOFO.mdb";
final static String DB = "jdbc:ucanaccess://" +DBPAD;

public void HaalKlantNamen(){
        Connection con;
        Statement s;
        ResultSet rs = null;
        DefaultTableModel table = (DefaultTableModel) NewOrder.table.getModel();

        try {
            con = DriverManager.getConnection( DB ,"",""); 
            s = con.createStatement();
            rs = s.executeQuery("select * from Item"); 

            if (rs != null) 
                while ( rs.next() ) {
                    String[] product = new String[2];
                    product[0] = rs.getString("ItemSoort");                    
                    product[1] = rs.getString("Naam");                    
                    table.addRow(product);
                }
            s.close();
            con.close();
        } 
        catch (SQLException e) {
            System.out.println("Error2: " + e);
        }
    }

      

+3


source to share





All Articles