• Post Reply Bookmark Topic Watch Topic
  • New Topic

Facing problem with startWith() in for loop  RSS feed

 
Happy S Singh
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is my snippet where I want to check in loop for all the queries passed that whether it starts with "SELECT" But I get the first query as true despite other queries are select



I get true in if(results[i].startsWith("SELECT")) only for the first select and after that for all other select's I get false
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried it and it works...
 
Happy S Singh
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah its working.but now I am stuck with other exception "java.sql.SQLException: error occurred during batching: batch must be either executed or cleared"

I am getting "java.sql.SQLException: error occurred during batching: batch must be either executed or cleared" in the below code.I want to execute two queries.

 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Happy S Singh wrote:in the below code....

Happy,

I split the very long line in your code. Please re-read the UseCodeTags page.

Winston
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably you can't, within the same Statement, execute select queries and batch updates.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!