0

Hi Guys,

Back again.

I'm having an issue with my java with mysql.

I have the following query generated through my java, which reads in about 3k records from an excel file and churns out an sql query for me.

For the purpose of this forum, ill show the first 5 lines.

INSERT INTO plans 
VALUES 
(NULL, 'AU10022','$99 Business Cap  24 Mths',24,250.0,8.5,'New'),
(NULL, 'AU10023','$99 Business Cap 12 Mths',12,175.0,8.5,'New'),
(NULL, 'AU10024','$149 Business Cap 12 Mths',12,294.0,8.5,'New'),
(NULL, 'AU10025','$149 Business Cap  24 Mths',24,420.0,8.5,'New'),
(NULL, 'AU10026','$229 Business Cap 12 Mths',12,378.0,8.5,'New')

Now, when i run this in java, i get an error message.
HOWEVER, when i run it through my mysql cli it runs perfectly.

Does anyone have an explanation as to why this might be?

Cheers
TC

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by tyson.crouch
0

Sorry guys, silly bit of programming on my part.

Put the stmt.exectute within the for loop, rather than after.
sorry

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.