Friday, May 24, 2013

how to test the database is exist or not (Try to create new DB, if DB is not here)


#Problem

java.sql.SQLException: Syntax error or access violation message from server: "Unknown database 'Workbook222'"

Fix:
Add "IF NOT EXISTS" to fix it.
CREATE DATABASE IF NOT EXISTS dbname;

No comments:

Post a Comment