aspose file tools*
The moose likes JDBC and the fly likes Query Correct, but not functioning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Query Correct, but not functioning" Watch "Query Correct, but not functioning" New topic
Author

Query Correct, but not functioning

Michael Paul
Greenhorn

Joined: Mar 29, 2008
Posts: 14
Hi,

I am trying to write to a DB from my code however the data is not writing to the database. I ran the SQL statement through the DB Frontend that I use and it worked, however through my code it does not work. Here is the snippit:




Any help at all would be appreciated, I am very stumped,

Atreides
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61201
    
  66

"Atreides", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459



But how would you know if anything was failing?
Michael Paul
Greenhorn

Joined: Mar 29, 2008
Posts: 14
I did a printStackTrace, and it said I couldn't use "executeQuery" to manipulate data. So I used executeUpdate and it worked, thanks for reminding me to do a printstacktrace, i was being dumb, thanks again!

Michael
[ April 16, 2008: Message edited by: Michael Paul ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Yes, you ninny :P

Although keep in mind that printStackTrace doesn't count as 'handling the exception' either, but it's one step better than swallowing it without comment.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Query Correct, but not functioning