There is a bug in the jdbc-odbc bridge. Try running a select on the same connection then see if the insert went through.
Almog mar
Greenhorn
Joined: Nov 28, 2010
Posts: 3
posted
0
David O'Meara wrote:There is a bug in the jdbc-odbc bridge. Try running a select on the same connection then see if the insert went through.
I dont understand...
This code: String sql="INSERT INTO RECIPESTABLE(RECIPENAME,INGREDIENTS)"+"VALUES('"+ fristName + "','Ingredients')"; is insert value
all work good the Eclipse run it....
If I change the code like that:"INSERT INTO RECIPESTABLE(RECIPENAME,INGREDIENTS)"+"VALUES('Pizza ','Ingredients')"; is insert value pizza and I want when you Enter your name it insert your name
and i dont know how to change this code for that this will run.
I'd recommend getting rid of access and trying to use a real database like MySQL with the Type 4 driver.
Failing that, I recommend doing this for your insert:
* get connection
* get statement for insert
* execute insert
* close statement
* get statement for select
* execute select, close ResultSet, close Statement
* close Connection
While you just throw out the results from the select, it is required to 'push' the insert statement through the Type-1 driver since due to a bug it can get stuck.
Another option is to setAutocommit(true) when you open a database Connection
Your code doesn't appear to close database resources when it is done with them, and this can also be the source of errors.