Image database
Hai java guys,
I need help from you for storing the images into a
database.Can anyone provide code for insert and
retrieve the image from sql-server as well as
oracle.For insertion i implement a class as
follows by using sql-server as backend.In the
imagetable image column is image type.After
execute this it is storing the image into image
column as some sort of string.is it right if so
how to retrive that image and save it to another
directory.
import java.io.*;
import java.sql.*;
public class ImageBLOB
public static void main(String[] args )
byte[] buffer1 = new byte[1024];
try
File file1 = new File(args[0]);
BufferedInputStream iStream1 =
new BufferedInputStream(new
FileInputStream(file1));
int eof1 =
iStream1.read(buffer1);
catch(Exception e)
{ System.out.println(e);}
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:basha",
"sa","");
Statement st =
con.createStatement();
st.executeUpdate("insert into
imagetable(image) values('"+buffer1+"')");
catch(Exception e)
{ System.out.println(e);}
Let me know how to insert into oracle also.it is
very urgent..so plz help me.thanks in advance.
Basha
Here is a link to an answer for Oracle:
http://forum.java.sun.com/thread.jsp?forum=31&thread=172263
I can't help you for other database than Oracle...
Similar Messages
-
Can I use Bridge CS6 as a central image database for linking to multiple documents?
Can I use Bridge CS6 as a central image database for linking to multiple documents?
It's only really good for Adobe document formats, if you want to be able to view and/or tag documents.
-
Hooks to networked image database.
I am looking for a workaround that might let me use lightroom as a "feeder" application to a larger image database that can also accept CMYK image files.
I have many thousands of corporate images many of which must be in CMYK format because my printers do not do a good job of RGB conversion.
Until some future version of Lightroom that might be network and CMYK aware, I would love to use lightroom to help me select new images from cameras, do color correction and create "initial" keywording that would accessible for new images within lightroom.
Then I could use lightroom for new images and also import these images into another program that would also let me see the legacy CMYK images and their keywords.
I know this would be duplication in many ways but until lightroom matures into a DAM (if ever) that can also handle CMYK it would be a workaround.
Any ideas?In this book ( Application Developer's Guide - Fundamentals Contents / Search / Index / PDF ) you can find that information:
Representing Large Data Types
In times gone by, the way to represent large data objects in the database was to use the LONG, RAW, and LONG RAW types. Oracle recommends that current applications use the various LOB types, such as CLOB, BLOB and BFILE, for this data.
See the Oracle9i Application Developer's Guide - Large Objects (LOBs) , for information about LOB datatypes.
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adfnstyp.htm#430288
Joel Pérez
http://otn.oracle.com/experts -
Migrating image database in Informix 9.21 to Oracle 9i
I am going to be migrating an image database from Informix 9.21 to Oracle 9i and am needing to know
what Oracle9i has to offer as far as options in storing large media types - image, video, audio, etc...
Specifically, does Oracle have anything comparable to Informix' smart blobspace? Is it possible to migrate
image data from Informix to Oracle? I know the migration kits only are available up to Informix version 7.
What does interMedia offer?Hi,
I was unable to reproduce your problem. I carried out the following steps in attempt to replicate the issue:
1. I launched the workbench, version 10.1.0.2, selecting the Oracle Lite "Default Repository".
2. Using the Oracle Enterprise Manager Console, I created a user "rtdb" with the password "rtdb" on my target Oracle 9i database.
3. I captured a test Informix database, generating its source and oracle models.
4. I then proceeded to migrate the database to Oracle and supplied my target Oracle9i database information in the "Migration Wizard, Step 1 of 4: Destination Database Details", supplying rtdb/rtdb as the username/password.
5. My test database migrated with no such error messages reported.
If you carried out the migration steps as I have outlined above, and are still experiencing issues with a "Failed to connect" error, I would contact support.
Regards,
Hilary -
Upload images & database fields at the same time
ASP VSBasic dreamweaver 8
I can browse & upload 2 images to the server using
aspupload (browse to
images click upload)
I can populate the MYSQL database using text fields &
recordset (enter data
in fields press save to upload)
I now need to work out the following on one button click
Browse & select first image
Browse and select second image
Pass the image paths to 2 text fields
upload the images
update the database
I end up with 2 images saved eg (C:\temp\image1.jpg &
C:\temp\image1.jpg)
A record in the data base with
Time
Date
"Path to image 1"
"Path to image 2"
The reason for the above is to keep the end user interface as
simple as
possible therefore the risk of them sending the wrong data is
reduced
Cheers
SteveWI'm not sure uploading several files at once is possible. I have yet to see anything like that.
-
Java ODBC image database with MS Access
hi ,
Can any one please tell me if it is possible to put and get image from MS Access database with java JDBC ODBC driver? If it is possible then what will be the data type in Access and java. Thanks in advance ��I've not seen a data type in Access that would be
appropriate for iimages--and I believe Access may
still have an overall size limitation (this may have
been taken off in Access 2003). If this were Oracle, you'd be using a BLOB. But the reasoning that follows would be the same, regardless of database.
What I'e had best
luck doing is leaving the files in their native
format and storing them in directory structures to
keep them segregated if need be, and storing their
names and locations in the DB.This is what I've seen done. It makes little sense to stick the JPEG bytes in the database. You can't use them in a WHERE clause. They just kill database performance. morgalr's solution is a good one.
% -
Kalimages PRO is an innovative tool to build your own database and search
engine for images.
Main features:
Collect full sets of standard images metadata:
- legacy IPTC/IIM
- new standard IPTC Core
- customized Extensible Metadata Platform (XMP) schemas filled with
custom panels on Photoshop or with Kalimages or any other XMP compatible
solution.
Collected metadata can be stored in any professional database which
supports ODBC: MySQL, PostgreSQL, Oracle, DB2, SQL Server, etc.
Platform: Windows 2000, XP, 2003, Vista (the database can be on any server)
Kalimages Pro can be used for example with DBSight, an online full-text
solution for relational databases. Its feature-packed out-of-the-box
installation allows IT professionals to setup, run, and maintain their
online full-text searches on any relational databases with minimum effort.
DBSight is based on Lucene, a free/open source information retrieval library supported by the Apache Software Foundation.
More information and download for test:
http://www.kalimages.net/EN/Index.html
Patrick Peccatte
www.softexperience.comPlease re-post if this is still an issue to the OnDemand Forum or purchase a case and have a dedicated support engineer work with you directly
-
I'm trying to create an application that uses a database to store pictures along with other info. My question is, how can I retrieve the images from the database and show them in a paging setup like the Data Table component? So far I have been able to store and retrieve images in the database, but only able to retrieve them to a file. I have not been able to figure out how to show a picture retrieved from the database to the page itself. Any help would be greatly appreciated.
Hi,
This forum thread may also help you:
http://swforum.sun.com/jive/thread.jspa?threadID=46410&start=10&tstart=0
Thanks,
Creator Team. -
Use dropdownlist to select image (database driven)
Im building a web application in flash builder which will be database driven. The database will contain id (of product), name (of product), photofile (text string i.e photo1.jpg). i have the data/services up and running, i just need to get it so when the user selects a name from the dropdownlist the corresponding photofile is selected into the picture frame.
I know to turn the photofile text into a picture it will be something like this but not sure what code to insert into the <s:Image tag;
private function getPhotoURL(item:Object):String{
return "http://............./assets/"+item.photofile;
I don't know how to bind everything together, any help would be appreciated.I have 2 programs:
First Pgm:
<?php require_once('Connections/abc.php'); ?>
<?php
mysql_select_db($database_abc, $abc);
$query_Recordset1 = "SELECT * FROM replyarticle";
$Recordset1 = mysql_query($query_Recordset1, $abb) or
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<a href="thumb.php?id=<?php echo
$row_Recordset1['postid'];?>"><img src= "idea.GIF"
width="20" height="19" border="0" /></a></p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
Second pgm: thumb.php
<?php require_once('Connections/abc.php'); ?>
<?php
$colname_Recordset1 = "-1";
if (isset($_GET['id'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['id']
: addslashes($_GET['id']);
mysql_select_db($database_abc, $abc);
$query_Recordset1 = sprintf("SELECT * FROM replyarticle WHERE
postid = %s", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $abb) or
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=" />
<title>Untitled Document</title>
</head>
<body>
<?php
$img= $row_Recordset1['book_no']; ?>
<?php
$img_name=$img;
header("Content-type: image/jpeg");
list($w,$h)=getimagesize($img_name);
$src_img=imagecreatefromjpeg($img_name);
imagejpeg($src_img);
imagedestroy($src_img);
mysql_free_result($Recordset1);
?>
</body>
</html>
Micha, am I working on what you said? -
Editing Image database columns From Apex front End
Hello,
How is it possible to edit an image datatype in Application express. Suppose if i want to edit an existing i mage and replace it with an edited version and save the newly edited verison in the database.
Is it possible to edit and image from the front end itself.Hello,
It depends exactly what sort of functionality you mean by 'edit', if you mean resize/scale and things like that then read the previous links I supplied.
If you mean duplicating the sort of functionality that Photoshop et al provide then yes it's probably possible, however it sounds like a huge amount of work to me (as in it would be a 'product' in it's own right).
If you can start defining limits as to what editing features you want to provide then I think it will help to define the scale of your task, otherwise if you're just saying 'edit' as a catch-all phrase then I think you have a lot of work ahead of you (interesting work...but a lot of it ;).
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! -
Large Images Database Management
I want to know that can I store my images (of size nearly 1 GB each with JPEG 2000 extension) directly in database (SQL server)? or will I store them in server directory,
like in folder structure by year vice order? which one is better? In SQL server option what implementation strategy will be preferable?
Engr. Mudassar Ali Software EngineerYou can map a drive letter to the UNC path as you can any other share. For example:
NET USE D:
\\YourServer\ServerShare\DatabaseDirectory\FileTableName
Below is a tested example of triggers to maintain the meta data table. Slightly different than the example David provided but you get the idea. This will associate the meta data with the parent folder and images within whenever an image
file is created, updated or deleted. The expectation is that the XML file is created/updated before the image file.
CREATE TABLE dbo.LocationImage AS FILETABLE
WITH
FILETABLE_DIRECTORY = 'LocationImage',
FILETABLE_COLLATE_FILENAME = SQL_Latin1_General_CP1_CI_AS
GO
CREATE TABLE dbo.LocationImageMetaData(
image_folder_path_locator hierarchyid
,vertex_id int IDENTITY
,longitude decimal(18,14)
,latitude decimal(18,14)
,CONSTRAINT PK_LocationImageMetaData PRIMARY KEY(image_folder_path_locator, vertex_id)
GO
CREATE TRIGGER TR_I_U_LocationImage
ON dbo.LocationImage
FOR INSERT, UPDATE
AS
BEGIN TRY
DECLARE @ImageFolder TABLE(
path_locator hierarchyid PRIMARY KEY);
--get list of folders with inserted or updated images
INSERT INTO @ImageFolder
SELECT DISTINCT parent_path_locator AS path_locator
FROM inserted
WHERE
is_directory = 0
AND file_type = 'jpg2000';
--remove existing meta-data for modified folders
DELETE dbo.LocationImageMetaData
WHERE image_folder_path_locator IN(
SELECT path_locator
FROM @ImageFolder
--insert meta-data for new and changed images
WITH
meta_data_files AS (
SELECT
image_folder.path_locator
,CAST(file_stream AS xml) AS meta_data_xml
FROM dbo.LocationImage
JOIN @ImageFolder AS image_folder ON
image_folder.path_locator = LocationImage.parent_path_locator
WHERE
LocationImage.file_type = 'xml'
INSERT INTO dbo.LocationImageMetaData(
image_folder_path_locator
,longitude
,latitude
SELECT
meta_data_files.path_locator
,Vertex.value('./LON[1]', 'decimal(18,14)')
,Vertex.value('./LAT[1]', 'decimal(18,14)')
FROM meta_data_files
CROSS APPLY meta_data_files.meta_data_xml.nodes('//Dataset_Extent/Vertex') AS Dataset_Extent(Vertex);
END TRY
BEGIN CATCH
THROW;
END CATCH;
GO
CREATE TRIGGER TR_D_LocationImage
ON dbo.LocationImage
FOR DELETE
AS
BEGIN TRY
DECLARE @ImageFolder TABLE(
path_locator hierarchyid PRIMARY KEY);
--get list of folders with deleted images
INSERT INTO @ImageFolder
SELECT DISTINCT parent_path_locator AS path_locator
FROM deleted
WHERE
is_directory = 0
AND file_type = 'jpg2000';
--remove existing meta-data for folders with no images
DELETE limd
FROM @ImageFolder AS image_folder
JOIN LocationImageMetaData AS limd ON
limd.image_folder_path_locator = image_folder.path_locator
WHERE NOT EXISTS(
SELECT *
FROM dbo.LocationImage
WHERE
LocationImage.parent_path_locator = limd.image_folder_path_locator
AND LocationImage.is_directory = 0
AND LocationImage.file_type = 'jpg2000'
END TRY
BEGIN CATCH
THROW;
END CATCH;
GO
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
Image database corrupt!!
i have changed my memory card from 4gb to 8gb. And copied all the files as such from old card to new card..
Now got a problem in this.. In my gallery the images are not exactly shown as before.. Only the newer images are shown in the gallery and the older files are not shown.. Also some new files with crossed icon is shown in gallery as unsupported files..
But when opened with filemanager the images are shown..
Pls help.. :-)How did you copy the images from one MC to the other ? If you still have these pictures on the old MC.. Fiirst insert that in the phone and sync all of them in the OVI Suite on your PC.. Then replace the MC and drag-and-Drop all back on to the phone icon visible in the lower window...Check if it works OK now..
-
Retrieving an image from the database and printing it
Can anybody help please
i dont know how to retreive an image from a image database and send to the printer.
The image is stored in the database in cells ( not as a path to a file).Hi,
I want to print a gif image.
How can i get this done?
I am trying graphicsobject.drawImage(....),it prints the image only once.If i try second time the image wont be printed,where as if i switch off and then switch on the printer and try again ,then it will print.I am facing the same problem with a HP Laser Jet as well as a thermal Printer.Actually i want to print a bar code.
some body pls help me to sort this issue.
Regards,
ciju
[email protected] -
Optimizing communication with database image archive
Hi!
I'm making a java program to show the contents in a image-database which is sorted in folders. I'm displaying this in a DefaultMutableTreeNode model. When you click on a imagefile, it's displayed next to the folders.
I'm wondering if any of you have any ideas how to optimize the communication between the database and the client?
I can't retrieve all the files at once and then display the tree, it could be gb of information.
So I'm wondering if I should send a DB call and get the files for each folder when opened? Or download the names of the files and get every single image clicked with a new DB call?
Or....Any ideas??
Thanks :-)I can't retrieve all the files at once and then
display the tree, it could be gb of information. Just display the image meta-data. What do you need to get all the images themselves for? They don't even provide the information you need for the tree.
So I'm wondering if I should send a DB call and get
the files for each folder when opened? Or download
the names of the files and get every single image
clicked with a new DB call? I'd do the latter. Much faster - otherwise, openeing a big folder takes a looooong time. -
Upload and display image in webside
Hello Friends,
I am developing an auction web site ,and facing some problem so I need your help.
There is some confusion about uploading and displaying images in website .In web based
application if I want to upload images than where have to store the images database or server
side any folder .I have not idea about that please send your ideas and sussesions.
Second problem is What is the best way to display images in webside either giving a direct
path of server side image folder or I need to retrieve all images from database .
I have no idea about it please send me your guideline which are usefull for me to implement in my
website.
what is the correct way to upload and display images in website ?
Thanks . Have a nice day.If you are using a Container you just leave your image files in the home directory of your web application. And forget this idea about database. It´s not necessary in this case.
To display the images just use HTML, <img src="url">.
Maybe you are looking for
-
Dear Friends, I want to see customer collection history Invoice wise. Means what collection received against which invoice. any help will be highly appricated. Regards Malik
-
Function module to change the reason code for status in a Opportunuity/lead
Hi, What is the function module to change the opportunity reason. I was able to change the status using the crm_order_maintain but How can I change the reason for that opportunity. Thanks naveen
-
Historicize - Incoming Sales Orders
Hallo, I extract SD Sales: Document Item data from DataSource 2LIS_11_VAITM into a DSO Document Items. I should historicize the Incoming Sales Orders.Therefore, I add an additional key (0CALMONTH) (u201CStatistics dateu201D in DS) in the DSO. New key
-
I try to install Oracle 8i (64bit version) on Solaris 7 (6144MB RAM). The SW installation process ran up to the stage where the screen of the installation types appear then hangs at 42% while setting up the Install types no matter what install type I
-
About reciptent of Interactive Dashboard
By the following procedure, iBot creator can see Warning icon in its dashboard. 1) Navigate to "Delivers". 2) Click "Destinations" hyperlink. 3) Click on "User Destinations: Interactive Dashboard". Regarding reciptent of "Interactive Dashboard", can