views:

262

answers:

1

I user the java.sql.Statement.excecuteUpdate method to create a table and insert some values into the database through JDBC. However, it gives me MySQL syntax exceptions for no reason. I copied and pasted the same code into command prompt. it worked.

I'm wondering why it's doing that??

+2  A: 

Guessing

You cannot do a query like: insert ...; insert ... ; only one query per method call

dfa
is there an easy way to do a bunch of insert?
CKeven
using java.sql.Statement, with the following methods: addBatch, executeBatch, clearBatch
dfa