lalit_louis
lalit_louis

Reputation: 35

SQL State error while JDBC'ing to a db2 database

I am using JDBC to connect to a db2 database and have the following sql to insert some values into the database.

sql="insert into HC_PROPF.PATIENT (given_name) values ('"+strArray[0]+"');";

However, I get a SQL STATE error as follows:

DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=@;ME) values ('Lorna');END-OF-STATEMENT, DRIVER=3.66.46

Thanks guys.

Upvotes: 1

Views: 1531

Answers (1)

MaVRoSCy
MaVRoSCy

Reputation: 17849

try it without the last ; in your query

sql="insert into HC_PROPF.PATIENT (given_name) values ('"+strArray[0]+"')";

According to documentation this is a syntax error

Upvotes: 3

Related Questions