I am having trouble connecting to my database, I keep receiving this error.
System.out.println("Start of connect class");
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");System.out.println("Driver loaded");System.out.println("start of connection");connection=DriverManager.getConnection("jdbc:ucanaccess://C:/Users/KC/Documents/NetBeansProjects/HappyUCan/src/happyucan/DataBase/wkennel.mdb");System.out.println("Database Connected");
run:
Start of connect class
Driver loaded
start of connection
Exception in thread "main" net.ucanaccess.jdbc.UcanaccessSQLException: object name already exists: Z_1
at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:210)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at happyucan.HappyUCan.main(HappyUCan.java:43)
Caused by: java.sql.SQLSyntaxErrorException: object name already exists: Z_1
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.executeUpdate(Unknown Source)
at net.ucanaccess.converters.LoadJet.execCreate(LoadJet.java:1017)
at net.ucanaccess.converters.LoadJet.access$0(LoadJet.java:1012)
at net.ucanaccess.converters.LoadJet$TablesLoader.createSyncrTable(LoadJet.java:357)
at net.ucanaccess.converters.LoadJet$TablesLoader.loadTable(LoadJet.java:569)
at net.ucanaccess.converters.LoadJet$TablesLoader.loadTable(LoadJet.java:557)
at net.ucanaccess.converters.LoadJet$TablesLoader.loadTables(LoadJet.java:674)
at net.ucanaccess.converters.LoadJet$TablesLoader.access$3(LoadJet.java:664)
at net.ucanaccess.converters.LoadJet.loadDB(LoadJet.java:1069)
at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:199)
... 3 more
Caused by: org.hsqldb.HsqlException: object name already exists: Z_1
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.Table.addColumn(Unknown Source)
at org.hsqldb.ParserDDL.compileCreateTableBody(Unknown Source)
at org.hsqldb.ParserDDL.compileCreateTable(Unknown Source)
at org.hsqldb.ParserDDL.compileCreate(Unknown Source)
at org.hsqldb.ParserCommand.compilePart(Unknown Source)
at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
at org.hsqldb.Session.executeDirectStatement(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
... 14 more
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Even when Access can support crazy naming of columns and tables, ucanaccess can't support yet few combinations(because it uses another dbms, yet in most of the cases it gets crazy names digestible).
I hope that in the 3.x.x I'll be able to do something better.
So, in the Calendar table there is a column named 1 and another one named -1(let me say, it isn't a best-practice). This causes an "escaping collision".
Please, rename them in something more usual (e.g plus and minus).
Last edit: Marco Amadei 2014-10-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the response, I will look into changing the column names. I am not the original creator of the database and the database is part of an existing program. Thanks again for your response, a huge help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have made the changes to the column names and it worked just fine. I do not see the column names being used in the existing program from my view point... cross your fingers. Hopefully version 3.0.0 can handle the wrong naming of columns and I switch it back, for compatibility sake. Thanks again!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am having trouble connecting to my database, I keep receiving this error.
System.out.println("Start of connect class");
There could be something strange in your column/table naming...
Could you attach your db(data are not needed)?
Which ucanaccess version are you using?
Ucanaccess is version 2.0.9. The Database I will have to clean up, I have some client data in it. Please give me some time to clean up database.
Ok, here is my database:
Ok, here is my database:
Both of the links are the same, I hit post 2 times.
Even when Access can support crazy naming of columns and tables, ucanaccess can't support yet few combinations(because it uses another dbms, yet in most of the cases it gets crazy names digestible).
I hope that in the 3.x.x I'll be able to do something better.
So, in the Calendar table there is a column named 1 and another one named -1(let me say, it isn't a best-practice). This causes an "escaping collision".
Please, rename them in something more usual (e.g plus and minus).
Last edit: Marco Amadei 2014-10-02
Just to complete the answer, the 3.0.0 should be the next version(the development will take about 1 month).
Thank you for the response, I will look into changing the column names. I am not the original creator of the database and the database is part of an existing program. Thanks again for your response, a huge help!
I have made the changes to the column names and it worked just fine. I do not see the column names being used in the existing program from my view point... cross your fingers. Hopefully version 3.0.0 can handle the wrong naming of columns and I switch it back, for compatibility sake. Thanks again!