0

I have a problem inserting data to my mysql database table. I have an error :

Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find output table 'book'.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3109)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:337)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:287)
    at connectTest.ConnectTest.insertPerson(ConnectTest.java:55)
    at connectTest.ConnectTestDemo.main(ConnectTestDemo.java:16)
Java Result: 1

I don't know why could not find my table.

I have created that in mysql database.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

-1

Please provide your source code and configuration file so that I can help you better.

Can you correctly connect to the database? You said you are using MYSQL database but I see you are using MS Access ODBC driver for the connection. If that is the case I recommend you use the MYSQL JDBC driver which you can download from

http://dev.mysql.com/downloads/connector/j/

If you can connect to the database correctly, then you may have not set your database schema (database name) properly. Please provide your source code and configuration file so that I can help you better.

For an example of how you should configure db using pure JDBC have a look at this link: http://www.tutorialspoint.com/jdbc/jdbc-insert-records.htm

Basically you provide a connection url in the format jdbc:mysql://[MySQLServer_DOMAIN_NAME_OR_IP_ADDRESS]:[PORT]/[DB_NAME].

Ali Motevallian
  • 1,250
  • 10
  • 15