• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SQL Execution

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,

I have had one post here related with this software so I just want You to know that the problem is not same as there.

First of all what id does, it read all .sql files from specific folder and save them to JList. After that I have 2 buttons.

One is "Manual execution" that execute only selected script. Second is "Automatic execution" that should read one by one script and execute until or if find any error.

Also it is removing executed file from JList.

Now, the "Manual execution" works great and everything is working perfectly.

But "Automatic execution" give me error:



I think that code break at this part


But I am not really sure why, as in "buf.toString()" SQL command is readed perfectly.

This is my code:
(I am sorry for posting long code)





 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Log the SQL before executing it to see exactly what query is causing the issue, and how your Java code sees the query.

However, it looks like you are using executeUpdate with a SELECT, or similar.
 
Gaios Augustus
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Tolls wrote:Log the SQL before executing it to see exactly what query is causing the issue, and how your Java code sees the query.

However, it looks like you are using executeUpdate with a SELECT, or similar.



You are right, I have to find way to bypass SELECT. Maybe I should use "Execute" instead to execute all but can I skip somehow return results?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic