posted 20 years ago
Hello All,
I am still having problems with my code.
I want to be able to insert data from a file into a database but when i spell one of the column names wrong (on pupose), it inserts the data that is correct then thows the exception, I dont want this as I want the exception to be thown first. If all the names are correct then go ahead and insert.
I ahve tried the commit() and rollback() methods but I am still getting the same responce.
I dont know what I am doing wrong so could someone please help me?
Thanks Ben
here is my code:
I have tried print out before the preparredStatement and the executeUpdate statmnet and this is the output:
prepare
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
prepare
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
prepare
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
one
two
prepare
one
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Sever] Invalid column name 'Postcod'.