Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

shay main

Greenhorn
+ Follow
since Oct 28, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by shay main

I was getting pretty tight on time so I ended up giving up and just storing the images in a local folder rather than the database ;-(

I'll go back and try and get it working when I have some spare time. Thanks for all your help Rob.
9 years ago
Nah, that didn't work....

Exception in thread "main" org.eclipse.swt.SWTException: Unsupported or unrecognized format
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.SWT.error(SWT.java:3969)
at org.eclipse.swt.internal.image.FileFormat.load(FileFormat.java:82)
at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:130)
at org.eclipse.swt.graphics.ImageDataLoader.load(ImageDataLoader.java:22)
at org.eclipse.swt.graphics.ImageData.<init>(ImageData.java:331)
at org.eclipse.swt.graphics.Image.<init>(Image.java:545)
9 years ago
Trust me to find one

I tried to use getBlob() and setBlob() previously and they aren't supported either.

So you reckon I need to do the following?

9 years ago
Thanks for your help Rob.

Unfortunately, neither of the SQLite JDBC Drivers that I have tried have implemented the getBinaryStream() method. I get the following:

java.sql.SQLException: not implemented by SQLite JDBC driver

These are the two libraries I have used...

http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC - version 3.7.2
http://www.zentus.com/sqlitejdbc/ - version 056


9 years ago
Hey all,

I'm not sure if this should be in the SWT section or the JDBC section.

I'm writing a basic Java application that allows a user to insert details about individuals into an SQLite database. I'm using Eclipse SWT for the GUI.

Eclipse SWT defines a type Image (org.eclipse.swt.graphics.Image) for displaying Images in a GUI.

I am trying to allow a user to browse the file system, select an image and then insert that image into a database. I also want to be able to retrieve that image from the database and display it in the GUI.

All pretty straightforward, but for the life of me I can't get it to work!! I've searched around a lot too and can't seem to find a solution to this.

I'll attach my code below, and I'm using:
Eclipse IDE for Java Developers (3.6)
sqlite-jdbc-3.7.2.jar
jdk1.6.0_22

Thanks in advance!

Shay

9 years ago
Hey all,

I'm not sure if this should be in the SWT section or the JDBC section. Can you post the same message in two separate forum categories?

I'm writing a basic Java application that allows a user to insert details about individuals into an SQLite database. I'm using Eclipse SWT for the GUI.

Eclipse SWT defines a type Image (org.eclipse.swt.graphics.Image) for displaying Images in a GUI.

I am trying to allow a user to browse the file system, select an image and then insert that image into a database. I also want to be able to retrieve that image from the database and display it in the GUI.

All pretty straightforward, but for the life of me I can't get it to work!! I've searched around a lot too and can't seem to find a solution to this.

I'll attach my code below, and I'm using:
Eclipse IDE for Java Developers (3.6)
sqlite-jdbc-3.7.2.jar
jdk1.6.0_22

Thanks in advance!

Shay