I am trying to execute and SQL query in java using the method executeQuery(String) of Class "Statement" i.e.
Statement stmt = null;
stmt.executeQuery(sql); /* sql is an insert statement in sql */
However, I am getting message of an exception of the class "SQLException" saying, "There was an internal database error". The thing worth mentioning is that when I fire the same "insert" statement denoted by string "sql" directly onto the database, the query gets fired successfully.
What is the root cause of this problem where in the query is getting fired direclty in the database but not in java?
2006-10-25
18:59:21
·
3 answers
·
asked by
chinmay p
1
in
Computers & Internet
➔ Programming & Design