• Post Reply Bookmark Topic Watch Topic
  • New Topic

Image insertion in database  RSS feed

 
Gursewak Singh
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code to insert image in DataBase
Table contain two column first is of BLOB type and second has integer type
This is my code

when i compile this p=code it show exception

unimplemented and unsupported conversion exception
this code runs pretty well on other computer
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gursewak: please UseCodeTags (←click) when posting to these forums. I've done it for you this time, but in future...

I also split one long line of yours, as they often cause display problems.

Winston
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gursewak Singh wrote:when i compile this p=code it show exception

Could you also please post the exact exception, including any stacktrace that came with it (the first 10-20 lines is usually enough if it's very long) along with an indication of exactly which line in your code it occurred.

Thanks.

Winston

PS: Welcome to JavaRanch.
 
Kushal Khot
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why did you do the
setInt(2,1)
?
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means to set the 2nd position in the statement to an int value 1.

Or similar.
 
Kushal Khot
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:It means to set the 2nd position in the statement to an int value 1.

Or similar.


Yes but, why do you need to do that ? is it ok, if it is eliminated ?
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kushal Khot wrote: . . . Yes but, why do you need to do that ? is it ok, if it is eliminated ?
No idea.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!