Bookmark Topic Watch Topic
  • New Topic

Attaching Pictures

 
Rohan Kalra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
So I don't know how much this falls under the JDBC category but if I am using JDBC to connect my Java application to a MySQL database, how can I add functionality for attaching pictures to this application?
Any advice would be much appreciated.
Thanks,
Rohan
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Rohan Kalra wrote:So I don't know how much this falls under the JDBC category but if I am using JDBC to connect my Java application to a MySQL database, how can I add functionality for attaching pictures to this application?
Any advice would be much appreciated.
Thanks,
Rohan


need more info. Where are the pictures coming from and where are they going to? Are you talking about users uploading pictures?
 
Rohan Kalra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
So it's like a mock-up of a prison system. A very basic one. Say the prison official using it enters details of crimes and inmates and then wants to attach pictures to the inmate details. He has the image files on his computer, but he just wants to attach the correct file to an inmates profile.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Is this a desktop app or a web app?
 
Rohan Kalra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
desktop
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34229
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Rohan,
The first thing to decide is whether you want the pictures in the database or on the server with a path to the picture in the database.
 
Rohan Kalra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
So I figured it would probably be better to have the pictures on the server or even the local machine since the pictures will be used by only one section/division. I'm not exactly sure how this works to be honest but I do realize that putting in a couple of pictures for every entry will probably take up too much space on a database.
 
Rohan Kalra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
So anyone have any idea at all? I skipped this for a few days but still failed when i tried some stuff last night, probably cause I have no idea. I want to be able to add images to my Java Application that uses JDBC to connect to a MySQL database. The images will be stored on the local machine, not on the server. Thanks.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Rohan Kalra wrote:So anyone have any idea at all? I skipped this for a few days but still failed when i tried some stuff last night, probably cause I have no idea. I want to be able to add images to my Java Application that uses JDBC to connect to a MySQL database. The images will be stored on the local machine, not on the server. Thanks.


share what you have tried. What code are you using to get images from local filesystem?
 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
i would suggest you better use path to the image files because otherwise it will take quite some space on the database itself ... and it's easy too as you just have to read the files location but then you will need to employ certain mechanism to read those files from their respective locations every time the view changes

but as you are probably going to save those image files on the desktop machine itself you can this shouldn't be much of an issue ...

anyways you should google about which format mySQL uses for images ... and you can then easily retrieve the images from there using the "blob" type ... JDBC

i think mySQL uses bit type but i'm not sure
 
Jan Cumps
Bartender
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
If you want the pictures stored on the local machine, then this is not a JDBC related post.
JDBC implies that you want to store the image on the database server, but you don't want that.



 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
The conversation continues here.
 
    Bookmark Topic Watch Topic
  • New Topic