How to execure an SQL insert statement using Java?
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?
How to execure an SQL insert statement using Java?
its quite simple just go to the following sites there are very good samples good luck http://www.planetsourcecode.com
- C++......................?
- is there a less complicated c++ compiler than microsoft express 2008? i found it to complicated and hav found no other free program to make a fps. a t..
- C++???????
- I am trying to make a tic tac toe game for c++ but i dont know how to use an array to make the board. also after i make the board hiw do i code it so ..
- C++???????????????
- I HAVE NO IDEA WHAT C++ IS? and i have an exam tomorrow. I dont understand 1. character set 2.tokens. i also have the for statement program, if stat..
- C++..........................?
- where i find the best c++ programing books.C++..........................?AT www.esnips.com/C++..........................?Try doing a search. OReilly t..
- C++????????
- i need to know a simple program to concat two strings without using strcat inside operator overloading.plz help me with a program..............C++????..
- ...................c++?
- How would I create a program that that displays the sum of a sales amount in each of 4 regions, during a 3 month period, which would also display the ..
- "Smitfraud-C. Toolbar888&..
- I am a webmaster, and I am trying to build my website, but my computer keeps acting weird and seems to be going into random hybernation for no reason ..
- C programme...?
- I wrote a programme of calculator in C language. And it has two or three error so pl do correct them. And send me correct answer. Prog. is: #includest..
- C programme...?
- I wrote a programme of calculator in C language. And it has two or three error so pl do correct them. And send me correct answer. Prog. is: #includest..
- C programme...?
- I wrote a programme of calculator in C language. And it has two or three error so pl do correct them. And send me correct answer. Prog. is: #includest..
