What The H ell Is Going On Here?!
i try connecting to a database called "CONTACTS" using connection = DriverManager.getConnection("jdbc:derby://localhost:1527/CONTACTS");
but when i run my application i get this exception:
java.sql.SQLSyntaxErrorException: Table/View'CONTACTS' does not exist.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.client.am.Statement.executeQuery(Unknown Source)
at JavaPhonebook.ContactIO.loadContacts(ContactIO.java:73)
at JavaPhonebook.JavaPhonebook.<init>(JavaPhonebook.java:81)
at JavaPhonebook.JavaPhonebook.main(JavaPhonebook.java:482)
Caused by: org.apache.derby.client.am.SqlException: Table/View'CONTACTS' does not exist.
at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source)
at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
at org.apache.derby.client.am.Statement.executeQueryX(Unknown Source)
... 4 more
so i think ok i must connect to a table inside of the database. so i connect to the "A" table inside of the "CONTACTS" database connection = DriverManager.getConnection("jdbc:derby://localhost:1527/A");
but now i get another exception:
java.sql.SQLTransientConnectionException: The connection was refused because the database A was not found.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:207)
at JavaPhonebook.ContactIO.<init>(ContactIO.java:44)
at JavaPhonebook.JavaPhonebook.<init>(JavaPhonebook.java:80)
at JavaPhonebook.JavaPhonebook.main(JavaPhonebook.java:482)
Caused by: org.apache.derby.client.am.DisconnectException: The connection was refused because the database A was not found.
at org.apache.derby.client.net.NetConnectionReply.parseRDBNFNRM(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown Source)
at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source)
at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
... 6 more
Exception in thread"main" java.lang.NullPointerException
at JavaPhonebook.ContactIO.loadContacts(ContactIO.java:72)
at JavaPhonebook.JavaPhonebook.<init>(JavaPhonebook.java:81)
at JavaPhonebook.JavaPhonebook.main(JavaPhonebook.java:482)
what the h ell is goin on here?! first i try to connect to a database but it thinks im trying to connect to a table. and when i try connecting to a table it thinks im connecting to a database!

