Java Error - net.ucanaccess.jdbc.UcanaccessSQLException: malformed string: '

前端 未结 1 1845
北海茫月
北海茫月 2021-01-29 08:29

I have an error using uCanaccess to retrieve my database which I have saved in my desktop.

My code is below:

package Week11Package;

im

相关标签:
1条回答
  • 2021-01-29 09:14

    Well, first, import your libraries(the jar files in lib folder). http://sourceforge.net/projects/ucanaccess/files/UCanAccess-2.0.9.1-bin.zip/download

    Then check this out. This might help.

    Connection a = DriverManager.getConnection("jdbc:ucanaccess://C:\\Users\\Vince\\Desktop\\Teams.accdb");
    Statement s = a.createStatement();
    String sqlQuery = "SELECT PlayerID, PlayerName, TeamID " + "FROM PLAYER"+"'";
    ResultSet rs = s.executeQuery(sqlQuery);
    while(rs.next()){
    System.out.println("Connected to DB & found Data!!!");
    }
    
    0 讨论(0)
提交回复
热议问题