Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,438 members, 7,819,607 topics. Date: Monday, 06 May 2024 at 06:59 PM

Java Problem!need Help - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Java Problem!need Help (952 Views)

Please Solve This Java Problem. / Pls, Help Me In This Java Problem / Simple Java Problem (2) (3) (4)

(1) (Reply) (Go Down)

Java Problem!need Help by krap(m): 5:50pm On Nov 24, 2010
Good day people,
I have a derby database of 2000 pictures,i materialized it,converted it to an image and put it in a HashMap,it gave me a stack over flow error.I tried another option of materializing it and putting the materialized stream into a map and tried converting it on the go while surfing through them but it seems that the only one instance of the materialized inputstream is created.The last option was to access the database directly but it is an expensive operation.Does any one know any easy and efficient way to materialize and surf through the pictures?

Secondly,i embedded a table on a textpane and tried to print the textpane but the table did not print out?How can i make this possible?
Re: Java Problem!need Help by doncigalo: 2:37pm On Nov 25, 2010
Well instead of putting the images in a database ,an easy way is to put the images in a folder and then store the image links in the database. But if you want to store the images directly into the database you have to set the column data type of the table you wish to store the image to BLOB, and also you should create additional columns in the table which will store the name of the file and type of file be it .gif, .jpeg , .tif e.t.c.

The reason why you need these additional fields is that BLOB is a data type field which comprises of binary data only, you will also need a to develop a method/class to break down the image file into a binary stream (in java you will need to use the binary stream and buffer methods to do this) and store it as binary data. Then when your calling the image from the database , you will need another method/class to reconstruct the image file based on its file name and type. There are a couple of examples on-line that you could look up, but I will recommend using the folder method as it is much more efficient and convenient.
Re: Java Problem!need Help by candylips(m): 5:00pm On Nov 25, 2010
the right approach has been suggested by doncigalo. just construct the image in a directory location. construct its url and save the your to the db
Re: Java Problem!need Help by sleekdude1(m): 1:13am On Dec 03, 2010
Hi doncigalo
, can i meet with you, i have aproposition for you. Please send me email: dextatek@gmail.com
Re: Java Problem!need Help by Nobody: 8:52pm On Dec 05, 2010
at times, u just want ur app to deal with the database directly, depends on d circumstance

(1) (Reply)

Pls Some1 Shld Help Me With Vb Express Edition Tutorial Guild / Help Pls: / Commenting System

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.