Thursday, December 8, 2005, 03:46 PM - Java, MySQL
Symptom
While using JDBC, you get the following exception:
java.sql.SQLException: Can not issue data manipulation statements with executeQuery()
The query you wrote has INSERT, UPDATE or DELETE in it.
Solution
The JDBC standard does not allow this. So alter your way of executing the PreparedStatement.
Execute this with execute() or executeUpdate() instead of the very general executeQuery.
ExecuteQuery is only for real queries returning only values, not doing any data manipulation at all.
| permalink |
Tuesday, December 6, 2005, 05:18 PM - MySQL
Symptom
A connection to the mysql server with a certain user/password combination fails with the error:
Host is not allowed to connect to this MySQL serverConnection
Solution
Alter the host column in the mysql database user table to the host on which it fails or to %. Restart mysql or reload the grant tables and the login should be possible.
| permalink |
Tuesday, December 6, 2005, 03:55 PM - Java, MySQL
Symptom
Trying to start tomcat, but it will not load because of the following exception:
Exception opening database connection
java.sql.SQLException: com.mysql.jdbc.Driver
etc.
Solution
Download the mysql jdbc connector from www.mysql.com and put it in the tomcat/common/lib directory. The driver will now load.
| permalink |
Monday, December 5, 2005, 04:02 PM - MySQL
Symptom
A MySQL CREATE TABLE returns with this error statement:
ERROR 1005 (HY000): Can't create table './dbname/tablename.frm' (errno: 150)
Solution
One of the tables being referenced in the FOREIGN KEY syntax does not exist. Correct this and the error will be gone.
| permalink |





