Retrieve image from oracle table to vb front end
Hi
I want to create a table in oracle and want to insert an image to the table using lobs and i am trying to get display of image in visual basic form
please help me
solution send on [email protected]
thanx
Hi Rajat,
First of you, please post your technical questions at
http://forums.oracle.com/forums/index.jsp?cat=18
Now coming to your question, are you using java or pl/sql to insert the image into database.
If it is using jave then you can check the 'LOB Datatype' sample for inserting an image into LOB column. It is present at
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html
Regards,
Anupama
Similar Messages
-
Retrieve data from oracle table, table name passed in runtime into JSP
Hello All,
I am new to JSP, i have a requirement,
I need to retrieve data from oracle table, here table is passed at random. how to get the data displayed in JSP page.
can any one help me in that
thanks1) Learn SQL.
2) Learn Java.
3) Learn JDBC.
4) Learn DAO.
5) Learn HTTP.
6) Learn HTML.
7) Learn JSP/Servlet.
8) Learn JSTL.
9) Apply learned things and develop.
Whenever you stucks, please come back and post the specific coding/technical problem here. -
Using Java to Retrieve Images from Oracle
OracleResultSet.getCustomDatum method is deprecated. I was using this method to retrieve an ORDImage from an Oracle 9i database. What are developers using instead of getCustomDatum to retrieve images from the database. Thanks for all help in this matter.
Hi use getBinaryStream(java.lang.String) or getBinaryStream(int) of java.sql.ResultSet for retrieving images from database
Hope it will be useful
regards
chandru -
Populating selectboxes in form by retrieving data from oracle table
hi guys...im a student .......i was thinking if someone could help me out.
i am woking on a project which is being built using JSP with EL.(jstl)
My problem is.......i have 2 interdependent select boxes in my form,which are CATEGORY and SUB CATEGORY. I could populate the first select box dynamically by extracting the values from the database table CATEGORYDATATABLE as foll:
<sql:query var="q1" sql="select distinct(type) from catgorydatatable"/>
<select name=selectbox1>
<c:forEach var="a" items="${q1.rows}">
<option>${a.type}</option>
</c:forEach>
</select>
but the problem poped up when i tried to populate the second select box which is the subcategory.
ie for example
**if i select category as STUDENT from the first select box the second one should get populated with a of all student names......
**on selecting category as Employee in first select box i should get to see all employee names in second select box and these names are to be extracted from the table.
i tried the following code but it isnt working:
<sql:query var=q2 sql="select subtype from categorydatatable where type=${param.selectbox1}"/>
<select name=selectbox2>
<c:forEach var=b items="${q2.rows}"/>
<option>${b.subtype}</option>
</select>
please do help me with this.....i'd be very thankful on recieving a sample code on this
thank u....
shireeesha>
After installing the ODAC package, I can now see a list of new drivers., including:
1) Oracle in OraClient11g_home1This one is the one you installed when you installed the Oracle client.
2) Oracle in XEThis one was installed when you installed XE on the system.
Which one should I chose? I would have expected a Oracle Client in XE. Is there another ODAC package for the Express edition? I could not find any.I'd use the first one, though I don't use XE so have no experience with it. They're probably the same or very similar clients in this case.
When I get into the Oracle ODBC Driver Configuration, it asks me for:
TNS Service Name
However, the dropdown box appears empty. Could you provide me a pointer on how to continue with the TNS Service name?There is a bug with the 32 bit driver that makes the dropdown always empty. You can just type the name in.
Of course, that means you need to know the name. XE may have set that up for you already. Go to where you installed XE and look for a tnsnames.ora file, typically in the \network\admin folder. If your local database is set up there, you can copy that file to the same place in the other Oracle client's installation folder (\network\admin), and then type in the TNS name (that's the name before all the stuff in brackets).
If there isn't one already set up, you'll have to create it and for XE I honestly have no idea how to do that. My DBA does it for all our databases. :) -
Retrieve data from oracle table
hi,
i have uploaded a piece of xml format data in oracle and successfully uploaded but when trying to retrieve data it reterieve 0 records. Oracle version is given below:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
create table temp_loading_lob(
xml_id varchar2(3),
q_clob CLOB
nologging
create table temp_loading_xml
nologging as
select xml_id,xmltype( q_clob) q_xml
from temp_loading_lob;
XMl Data
<?xml version="1.0" encoding="ISO-8859-1" ?>
<Root xmlns="http://www.w3.org/2000/10/XMLSchema">
<Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
<Account AccountID="QF8AA000">
<AccountName>124 On Brunswick Bed & Breakfast</AccountName>
<Addresses>
<Address AddressID="aQF8AA000YMY">
<Description>Physical</Description>
<Address1>124 Brunswick Drive</Address1>
<Address2>Brunswick Park - RD 4</Address2>
<Address3></Address3>
<Suburb></Suburb>
<City>Rotorua</City>
<Postcode></Postcode>
</Address>
<Address AddressID="aQF8AA000WXX">
<Description>Postal</Description>
<Address1>PO Box 7365</Address1>
<Address2></Address2>
<Address3></Address3>
<Suburb>Te Ngae</Suburb>
<City>Rotorua</City>
<Postcode>3042</Postcode>
</Address>
</Addresses>
</Accounts>
</Account>
</Root>
Query used to reterive data
select po.*
from temp_loading_xml p,
XMLTable('/Accounts/Account'
PASSING p.q_xml
COLUMNS
AccountID varchar2(20) PATH '@AccountID'
,AccountName varchar2(20) PATH 'AccountName'
)poi am trying to catch my error but unable to fix it. Any help will ge greatly appretiated. How can i close my thread?
Best Regards,
Zaid>
<Root xmlns="http://www.w3.org/2000/10/XMLSchema">
<Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
<Account AccountID="QF8AA000">
</Accounts>
</Account>
</Root>
>
must be
<Root xmlns="http://www.w3.org/2000/10/XMLSchema">
<Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
<Account AccountID="QF8AA000">
</Account>
</Accounts>
</Root>and add namespaces to xmltable
32 select po.*
33 from temp_loading_xml p,
34 XMLTable(
35 xmlnamespaces(default 'http://www.w3.org/2000/10/XMLSchema')
36 ,'Root/Accounts/Account'
37 PASSING p.q_xml
38 COLUMNS
39 AccountID varchar2(20) PATH '@AccountID'
40 ,AccountName varchar2(20) PATH 'AccountName'
41 )po
42 /
ACCOUNTID ACCOUNTNAME
QF8AA000 124 On Brunswick Bed
SQL> -
GetBlob Error During fetching of Images from Oracle 10g
Dear Sir,
By using getBlob Function ,i am getting following error:"Unsupportable action has performed".
I am using oracle 10g.I am using java code to retrieve image from Oracle 10g.
So plz help me by giving full code with explaination.
Thankyou.
Yours Obedient
Dipesh KumarI seriously doubt Oracle would write error messages with such atrocious English.
So it's almost certainly an error from either your own code or code you're calling in some library or part of the application you're not mentioning that noone here except you has knowledge of.
Ergo, we're not going to be able to help you unless you provide a lot more information.
And no, we're not going to write your code for you. -
Retrieve specific range data from oracle table
Hi, Dear friends,
I want to retrieve all the data from oracle table and then save them to mysql table using JDBC ResultSet. The problem is that some oracle table is too big, if I retrieve all of them to memory at a once time using excuteQuery, the program will become no response out of memory limitation. So my question is if I can retrieve just specific range data once a time. I can¡¯t find this function through JDBC API. Also, I don¡¯t want to use the specific sql sentence, for example ¡°select ¡ from¡ where someid>¡ and someid<¡¡±, because there are many different tables, I want to transfer them automatically. So I can¡¯t construct such sql sentence in advance. Does anyone know if oracle JDBC driver provide such kind of function or does there any other way?
Any suggestion will be greatly appreciated!
SammyDear Justin,
thank you so much for your prompt reply!
as your suggestion, I do check the performance while my program is running, after the program become nearly no response, I found the memory usage is nearly 100%, while disk usage and process usage is pretty low. that's the reason why I guess maybe the memory limitation, but the strange thing is that no any error reported by JBuilder, it just nearly no response and don't transfer any data any more. my os is windows xp, the version of JBuilder is 7. my main memory is 768M. just as you said, the total 6,000 records in not very large, just no more than 400K. another strange thing is that why my program works well when there is little data records in the table.
the big picture of my program is first I retrieve oracle table metadata, according to this information, I construct DDL sql words and then create the corresponding table in mysql database. this part works well. in order to save your time, I will not paste the code here. then there is a method to transfer oracle data to mysql table, whenever creating the mysql table, then I will call this method to transfer datat to it. the following is the code of this method, I am very sorry to take your time. please read it when you are available.
thank you very much!!
Sammy
//transfer data from oracle to mysql!!!
private static void transferData(Connection oracleConn, Connection mysqlConn, String oracleTableName, String oracleSchemaName) throws SQLException{
Statement oracleStmt=oracleConn.createStatement();
Statement mysqlStmt=mysqlConn.createStatement();
// sending sql to oracle to retrieve data
String thisTableName=oracleTableName;
String oracleSQL="SELECT * FROM ".concat(thisTableName);
ResultSet oracleRS = oracleStmt.executeQuery(oracleSQL);
String sql="";
if (oracleRS.next()) {
ResultSetMetaData rsmd = oracleRS.getMetaData();
int colCount = rsmd.getColumnCount();
do {
String sqlBodyPart="";
String sqlValuePart="";
System.out.println("the number of column is "+colCount);
for (int i = 1; i <= colCount; i++) {
String columnValue = oracleRS.getString(i);
boolean b = oracleRS.wasNull();
String columnName =rsmd.getColumnName(i);
System.out.println("the value of column " + i + "is " + columnValue);
//construc the sql body part and value part
sqlBodyPart=sqlBodyPart.concat(" ").concat(columnName).concat(",");
if(b){ //if the value of the column i is null
sqlValuePart=sqlValuePart.concat(" null").concat(",");
}else{
sqlValuePart=sqlValuePart.concat(" '").concat(columnValue).concat("',");
//get rid of the last comma in sqlBodyPart and sqlValuePart
if(!sqlBodyPart.equalsIgnoreCase("")) sqlBodyPart=sqlBodyPart.substring(0,sqlBodyPart.length()-1);
if(!sqlValuePart.equalsIgnoreCase("")) sqlValuePart=sqlValuePart.substring(0,sqlValuePart.length()-1);
//construct the sql sentence!!!
sql="INSERT INTO ".concat(thisTableName).concat(" (").concat(sqlBodyPart).concat(") ").concat(" VALUES(").concat(sqlValuePart).concat(")");
System.out.println("the sql words for this column is");
System.out.println(sql);
System.out.println(" ");
if(mysqlStmt!=null){
int rows = mysqlStmt.executeUpdate(sql);
} else{
System.out.println("can't connect with mysql server");
System.exit(1);
while (oracleRS.next());
} else {
System.out.println("There are no data in the table...");
}//end of method data transfer!
//end of method data transfer! -
Want to scan an image from oracle forms -- Is it possible??
Hi all,
I want to scan an image from oracle forms through a scanner. I have not found any help on this topic. Pls help with example or code or with demmo form.
BR
Tarik.
Edited by: Tarik_kuet on Sep 9, 2008 1:39 PM
Edited by: Tarik_kuet on Sep 9, 2008 1:39 PMA colleague of me did it like this:
* the scanner is connected to a network document server.
* the document server sends(ftp) the image to the oracle XDB
* a form shows the scanned documents(using a view on the ftp directory in XDB using path_view)
* in this form the user can move the scanned document(s) to a (blob field) in a table.
Hope this helps a bit...
Edited by: poelger on Sep 9, 2008 10:08 AM -
Retrieving record from oracle DB very slow..pls help
Hi, i'm writing a VB code to retrieving records from Oracle DB Server version 8. I'm using VB Adodb to retrieve the records from various tables. Unfortunately one of the table are very slow to response, the table only contain around 204900 records. The SQL Statement to retrieve the records is a simple SQL Statement that contain WHERE clause only. Any issue that will make the retrieving time become slow? Is that a Indexing? Oracle Driver? Hardware Spec? Or any solution for me to improve the performance. Thanks!
Well, there are a few things to consider...
First, can you try executing your query via SQL*Plus? If there are database tuning problems, your query will be slow no matter where you run it.
Second, are you retrieving significantly more rows in this query than in your other queries? It can take a significant amount of time to retrieve records to the client, even if it's quick to select them.
Justin -
Image from Oracle BLOB is not showing
Hi all!
Im trying to use this code:
<?php
//... etc
$sql = oci_parse($c, 'select * from pf2.documents ');
oci_execute($sql);
echo "<table width = 200 border = 1 cellspacing=0 cellpadding=0>";
while ($row = oci_fetch_assoc($sql)) {
echo "<tr>";
echo"<td style=background-color:#DDDEEE; align=center>";
echo $row['SHORTNAME'] ;
echo"</td>";
echo"<td style=background-color:#DDDEEE; align=center>";
print $row['FILENAME'] ->load();
echo"</td>";
echo "</tr>";
echo "</table>";
//... etc
?>
Here im trying to select and publish an image from Oracle BLOB,
but in Mozilla Firefox im getting just whong text:
яШяа�JFIF��`�`��яЫ�C� $.' ",#(7),01444'9=82<.342яЫ�C 2!!22222222222222222222222222222222222222222222222222яА�МЂ"�яД����������� яД�µ���}�!1AQa"q2Ѓ‘Ў#B±БRСр$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzѓ„…†‡€‰Љ’“”•–—�™љўЈ¤Ґ¦§Ё©ЄІіґµ¶·ё№єВГДЕЖЗИЙКТУФХЦЧШЩЪбвгдежзийкстуфхцчшщъяД�������� яД�µ��w�!1AQaq"2ЃB‘Ў±Б #3RрbrС $4б%с
Please help!
P.S.: Im using PHP 5.2.10 under Wintel platform,
Oracle 9.2.0.4,
create table DOCUMENTS
DOCID NUMBER(10) not null,
SHORTNAME VARCHAR2(30) not null,
FULLNAME VARCHAR2(250) not null,
FILENAME BLOB not null,
AUTHOR VARCHAR2(30) not null,
CREATIONDT DATE not null,
VERSION VARCHAR2(10) not null
Edited by: user502299 on 28.09.2009 5:33I am having a similiar problem. I have created the image.php file:
<?
$query = "select a.image_file FROM officer_image a, officer_info b where a.officer_id=b.officer_id and b.officer_lname like 'LEDEZ%' ";
$stmt = @OCIParse ($db_conn, $query);
@OCIExecute($stmt, OCI_DEFAULT);
@OCIFetchInto($stmt, $arr, OCI_ASSOC+OCI_RETURN_LOBS);
$result = $arr['BLOB'];
@OCIFreeStatement($stmt);
@OCILogoff($conn);
$im = @imagecreatefromstring ($result);
if (!$im) {
$im = imagecreate(150, 30);
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
imagestring($im, 1, 5, 5, "", $tc);
Header("Content-type: image/jpeg");
Header("Content-Disposition: attachment; filename=filename_".uniqid(time()).".jpg");
imagejpeg($im,'',100);
imagedestroy($im);
?>
And then in the actual search web page:
<?php
$tname = $_POST['lname'];
$lname = "{$tname}%";
$id = "1";
//$query = "SELECT officer_id, image_file FROM officer_image WHERE ID='.$id.'";
$query = "select a.image_file FROM officer_image a, officer_info b where a.officer_id=b.officer_id and b.officer_lname like 'LEDEZ%' ";
//oci_bind_by_name($sql, ":bv", $lname);
//oci_execute($sql);
$stid = OCIParse($conn,$query);
Header("content-type:image/jpeg");
OCIExecute($stid, OCI_DEFAULT);
while($succ= OCIFetchInto($stid,$row)) {
foreach($row as $item) {
$blob_message = $item->load();
// Output the image
//imagejpeg($blob_message);
echo $blob_message . " " ;
//echo "<img src="image.php?id='.$blob_message.'" border="0">. $rows['officer_id']."\">\n";
echo "<br /><br />";
// Free up memory
//imagedestroy($im);
//while ($row = oci_fetch_assoc($sql))
?>
Can anyone help? -
Retrieve data from nested tables
Hi All,
I have big trouble to retrieve data from nested tables..
From java code developer are passing struct data type to Oracle procedure.. So equal data type in oracle has been created as created as object
CREATE OR REPLACE TYPE TXNDATA AS OBJECT
TRAN_ID NUMBER ,
EVENT_ID NUMBER ,
EVENT_CD VARCHAR2(10 BYTE))and create a procedure which has a IN parameter as TXNDATA
now i need to retrieve the column data's through SELECT clause such as
TYPE Proc_txn IS TABLE OF TXNJOURNALDATA;
EVENT_JOURNAL_SEQ Proc_txn;
select * from table(cast(EVENT_JOURNAL_SEQ));but above SQL will give all column data's but i need to retrieve only 2 column values such as
select EVENT_ID , EVENT_CD from table(cast(EVENT_JOURNAL_SEQ))how can i achieve the above result set?
Thanks & Regards
Sami.use a table alias in your query
SQL> set serveroutput on
SQL> create TYPE TXNDATA AS OBJECT
2 (
3 TRAN_ID NUMBER ,
4 EVENT_ID NUMBER ,
5 EVENT_CD VARCHAR2(10 BYTE));
6 /
Type created.
SQL>
SQL> create type txnjournaldata
2 as table of txndata;
3 /
Type created.
SQL>
SQL> declare
2 txn txnjournaldata := txnjournaldata (
3 txndata(10, 20, 'One')
4 ,txndata(10, 20, 'Two')
5 );
6 begin
7 for rec in (select tx.event_id
8 , tx.event_cd
9 from table (txn) tx
10 )
11 loop
12 dbms_output.put_line (rec.event_id||' - '||rec.event_cd);
13 end loop;
14 end;
15 /
20 - One
20 - Two
PL/SQL procedure successfully completed.Edited by: Alex Nuijten on Oct 24, 2011 12:24 PM -
Display distinct rows from Oracle table without using "DISTINCT" keyword.
How to retrieve distinct rows from oracle table without using 'DISTINCT' keyword in SQL?
Thanks in advance.
MihirWelcome to the forum.
Besides GROUP BY you can use UNIQUE instead of DISTINCT as well, but that's probably not wanted here ;) , and the ROW_NUMBER() analytic:
SQL> create table t as
2 select 1 col1 from dual union all
3 select 1 from dual union all
4 select 2 from dual union all
5 select 3 from dual union all
6 select 4 from dual union all
7 select 4 from dual;
Table created
SQL> select col1 from t;
COL1
1
1
2
3
4
4
6 rows selected
SQL> select distinct col1 from t;
COL1
1
2
3
4
SQL> select unique col1 from t;
COL1
1
2
3
4
SQL> select col1 from t group by col1;
COL1
1
2
3
4
SQL> select col1
2 from ( select col1
3 , row_number() over (partition by col1 order by col1) rn
4 from t
5 )
6 where rn=1;
COL1
1
2
3
4 -
Performance Issue: Retrieving records from Oracle Database
While retrieving data from Oracle database we are facing performance issues.
The query is returning 890 records and while displaying it on the jsp page, the page is taking almost 18 minutes for displaying records.
I have observed that cpu usage is 100% while processing the request.
Could any one advise what are the methods at DB end or Java end we can think of to avoid such issues.
Thanks
R.passion_for_java wrote:
Will it make any difference if I select columns instead of ls.*
possibly, especially if there's a lot or data being returned.
Less data over the wire means a faster response,
You may also want to look at your database, is that outer join really needed? Does it perform? Are your indexes good?
A bad index (or a missing one) can kill query performance (we've seen performance of queries drop from seconds to hours when indexes got corrupted).
A missing index can cause full table scans, which of course kill performance if the table is large. -
Extracting a flat file from oracle table
I have moved the knowledge module KIM ISO SQL to FileAppend from the Metadata to my project folder.
But when I create an interface mapping the oracle table and a flat file on a different unix server, in the drop down menu , it shows only KIM SQL TO SQL and KIM Control Append.It does not show up the SQL to FileAppend knowledge module option.
What should I do to extract a flat file from oracle table?
Thanks
Hima
Overstock.comAll IKM in the Drop Down Menu are dependent of the target technology.
A question, at this interface, is your target table a file ? -
Can we hide the tables and columns from subject areas in the front end
Hi,
Is there any way to hide the tables and columns from the subject area in front end.I need to create a report with some tables which the user does not want to see.So after creating the reprot can I hide those tables and columns in the front endHi,
Your question is not that clear to me...do you want to hide the entire table/column that dont want to show up in the front end then you could do in Presneation Layer in the RPD by going Permissions in the property of that object.
But if you want to hide the column in the report that can be visible in the subject Area: go to column properties -> Column fomat...thereis Hide option.
Can you please elaborate your question...what exactly you are looking for...
--SK
Maybe you are looking for
-
How to set session attributes in a bean?
How do I set a session attribute in a server-side bean? I'm not sure if I asked the question the right way. What I meant is, while it's easy to set session attributes in a JSP page (session.setAttribute("sessionname", "sessionvalue")), I'd want to se
-
I recently took approximately 300 pictures with a Canon Powershot camera during a 2 week vacation. During this time frame I put the photos onto my iPad 2 via an adapter and deleted them from my camera's memory card. Upon return my camera and iPad 2 w
-
Italic font on mac os 10.3.9 (panther)
Our application uses a customized table cell renderer to show italic fonts for non-ediable rows. It works fine on Mac OS 10.4 (Tiger), but not on 10.3.9 (Panther). The renderer just shows plain text for the rows, rather than Italic. I have found this
-
How is it possible to run MSL with JDeveloper?
Do I need a third party JDBC driver?
-
Hi I have been struggling with this for the last three days. I have tried multiple searches in the forums but cannot make head nor tail of setting the classpath in linux when compiling a package. in the following directory "/home/tamtam/Java/Course/U