Dowload blobs from Database
I know this is not the best way to store files but I have inherited an old php script which I am converting to CF because php is useless.
Now i have a script to do this in php but can this be achived with CF? It is just a quick fix until I have time to rework the CMS
<?php
if(isset($_GET['id']))
// if id is set then get the file with the id from database
$id = $_GET['id'];
$query = "SELECT name, type, size, content " .
"FROM upload WHERE id = '$id'";
$result = mysql_query($query) or die('Error, query failed');
list($name, $type, $size, $content) = mysql_fetch_array($result);
header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: attachment; filename=$name");
echo $content;
i
exit;
?>
My php experience is NILL, but applying basic coding experience I believe your CFML will be close to this.
<cfif structKeyExists(url,"id")>
<cfquery datasource="..." name="result">
SELECT name,type,size,content
FROM upload
WHERE id = <cfqueryparam value="#url.id#" cfsqltype="cf_sql_integer">
</cfquery>
<cfheader name="Content-Disposition: atachment; filename=#result.name#">
<cfcontent type="#result.type#" reset="yes">
#result.content#
</cfif>
If any of this content can be binary, then you may also need to use one or more of the toBinary() toBase64(), isBinary(), binaryDecode() or other relevant functions.
Similar Messages
-
How to show in a report a pdf blob from database
Hi all
We are working on report 6i and report 10. We have a report wich needs to show a blob field from database that storages a pdf (type application/pdf). OLE2 is deprecated. The pdf blob field must be displayed in a preview and must be printed. In local, it works. When it works on a browser, the pdf blob field is missing. If we load the field into a pdf file, the field is not visible in the browser.
Do not get it to work. How I can implement? Could you give us any example for this?In local, it works. What do you mean by that exactly? You see the pdf in Reports Builder?
If you just want to show the pdf in a browser (not embedded in a report) it is easy to use mod_plsql. You can have a simple db procedure like this to show any kind of blob:
procedure show_webdoc(io_blob in out nocopy blob
,i_mimetype in varchar2
,i_filename in varchar2)
is
begin
if dbms_lob.getlength(io_blob) >0 then
owa_util.mime_header(nvl(i_mimetype,'application/octet'),false);
htp.p('Content-length: ' || dbms_lob.getlength(io_blob));
htp.p('Content-Disposition: inline; filename="'||i_filename|| '"');
owa_util.http_header_close;
wpg_docload.download_file(io_blob);
end if;
end show_webdoc; -
Hi!
Im trying to get a blob from a database and write it to a file, but I just can't get the Blob value, I just recieve the adress. I've tried InputStream and getBytes but none of them does what I want. getBytes where closest but because it requires two inparameters (long pos, int length) and blob.length gives an long i can't figure out how many bytes to get. Anyone got any sugestions?Agrawal.
I've read through both those pages (even thou i've already managed to make the connection to mysql) and I still can't work around my problem. the method getBytes(), requires two parameters, one that tells it where to start reading and one telling it how long it should read. If I leave one out it will inevitable lead to problems. So I still need to figure out a way to get the length of the blob in a int to make this work. but since the blob.length() method returns a long wich I can't convert I'm stuck! -
Hi All,
I am trying to preview a 'jpeg' image which is stored in my database. The images get inserted into the DB without any trouble, but on retrieving the images I get 'broken links' to the images. Please Help:
PROCEDURE GET_TEAM_LOGO(team_name VARCHAR2)
AS
vblob BLOB;
buf RAW(32000);
buf_size INTEGER := 32000;
offset INTEGER := 1;
len NUMBER;
mime_type VARCHAR2(30);
BEGIN
auth_proc;
-- get image_data and its mime type from the database
WHERE LOGO_ID=position;
htp.p('This is the value of team:'|| team_name ||'<br>');
SELECT logo_image, logo_type INTO vblob, mime_type
FROM LOGO_TABLE
WHERE group_name = team_name;
-- set the mime type for the http protocol
owa_util.mime_header('image/jpeg');
-- read the data with htp package
len:=dbms_lob.getlength(vblob);
WHILE offset < len LOOP
dbms_lob.read(vblob,buf_size,offset,buf);
htp.prn(utl_raw.cast_to_varchar2(buf));
offset:=offset+buf_size;
END LOOP;
-- check for exception
EXCEPTION
WHEN OTHERS THEN
htp.p(SQLCODE || SQLERRM);
END;
Thanks,
PeterHi!
I've used this code successfylly in a mod_plsql procedure.
Can be used as following:
htp.img('http://yourhost:port/<dad>/image.get_image?p_picture_id=123,'"right"',null,null,'width=107 height=66 border=1');
procedure get_image
( p_picture_id number
) as
cursor c_pict
( b_picture_id number
) is
select pict.picture -- blob column
, pict.format -- Gif/Jpeg etc.
from pictures pict
where pict.picture_id = b_picture_id
r_pict c_pict%rowtype;
v_blob BLOB;
v_amt NUMBER := 30;
v_off NUMBER := 1;
v_raw RAW(4096);
begin
open c_pict(p_picture_id);
fetch c_pict into r_pict;
if c_pict%notfound
then
close c_pict;
else
close c_pict;
owa_util.mime_header('image/'||r_pict.format);
begin
loop
dbms_lob.read(r_pict.picture,v_amt,v_off,v_raw);
htp.prn(utl_raw.cast_to_varchar2(v_raw));
v_off := v_off+v_amt;
v_amt := 4096;
end loop;
exception
when no_data_found
then
null;
end;
end if;
end get_image; -
Retrieval of image (Blob) from database - doesn't always work in JSP - Why?
In my JSP pages, when an image needs to be retrieved, I direct <img src> to a servlet that handles image processing.
As an example, if I have 30 products that need to be shown on 1 webpage, there will be 30, dynamically generated, <img src="go.imageServlet?id=a1"> tags/statements. The servlet, when called, will make a connection to the database, run a query for the image requested (fetched as type Blob), image displays in <img src> area of JSP page, and finally the ResultSet, Statement, and Connection object(s) are closed.
I tested this out, and unfortunately, to my surprise, and disappointment, a few images did not display on the page. Though the images are in the database table. I'm a little lost as to why this problem is occurring.
Can someone please shed some light on this for me?evnafets wrote:
If you request just one image, does that image come back broken, or is it different images that are 'broken' each time?On a page of almost 30 image requests (thumbnail size), it varies, but typically, 1-3 images are 'broken' each time. And they are not always the same images. Very strange.
There may potentially be thread concurrency errors depending upon how you have written your servlet - ie one request for an image interfering with another because they use the same variable.
To make it threadsafe, in your servlet make sure that you only use variables local to the doGet/doPost method, and not any class attributes.In my JSP page that makes the requests for these images, a String array generates the <img src> tags on the page, as a very basic example :
<% for(int i=0; i<products.length; i++) {
%>
<img src="go.imageP?imageNumber=<%=products[[0]%>">
<% }//for %>
Sorry for not posting code snippets from my servlet in my first post of this topic....
Here is my servlet snippet - public class ImageProcessingServlet extends HttpServlet {
public Connection conn = null;
public ResultSet rs = null;
public Statement stmt = null;
public PreparedStatement pstmt = null;
public PrintWriter out = null;
public String siteNameReference = "";
int maxFullSizeImageWidth = 600;
int maxSizeImageWidth = 300;
int maxSizeThumbWidth = 140;
int maxImageFields = 4;
String errorMessage = "";
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
doPost(req,res);
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
try {
HttpSession session = req.getSession();
siteNameReference = req.getParameter("snr");
String process = req.getParameter("process");
if(process == null) process = "";
Context ctx = new InitialContext();
if(ctx == null )
throw new Exception("Boom - No Context");
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/imageDB");
conn = ds.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery("Select "+imageNumber+" from images");
rs.next();
Blob blobImage = rs.getBlob(1);
getImage(blobImage,"thumb",res);
if(rs != null) { rs.close(); }
rs = null;
if(stmt != null) { stmt.close(); }
stmt = null;
if(pstmt != null) { pstmt.close(); }
pstmt = null;
conn.close();
conn = null;
}//try
catch (Exception e) { }
finally {
if (rs != null) {
try { rs.close(); } catch (SQLException e) { ; }
rs = null;
if (stmt != null) {
try { stmt.close(); } catch (SQLException e) { ; }
stmt = null;
if (pstmt != null) {
try { pstmt.close(); } catch (SQLException e) { ; }
pstmt = null;
if (conn != null) {
try { conn.close(); } catch (SQLException e) { ; }
conn = null;
}//finally
}//post
public void getImage(Blob blobImage, String imageType, HttpServletResponse res) {
try {
//imageType will = Super = 600
// = Large = 300
// = Thumb = 150
res.reset();
res.setContentType("image/jpeg");
BufferedInputStream bis = new BufferedInputStream(blobImage.getBinaryStream());
BufferedOutputStream bos = new BufferedOutputStream(res.getOutputStream());
if(imageType.equals("super")) {
byte[] imageBytes = new byte[(int)blobImage.length()]; //picture size
int length;
while((length = bis.read(imageBytes)) > 0) {
bos.write(imageBytes, 0, length);
bos.flush();
res.flushBuffer();
} else
if(imageType.equals("large")) {
resize(bis,bos,maxSizeImageWidth);
bos.flush();
res.flushBuffer();
} else
if(imageType.equals("thumb")) {
resize(bis,bos,maxSizeThumbWidth);
bos.flush();
res.flushBuffer();
}//if
//close streams
bis.close();
bos.close();
}//try
catch(Exception e) {}
}//end
public void resize(BufferedInputStream bis, BufferedOutputStream bos, int maxImageWidth) {
try {
BufferedImage bufimg = ImageIO.read(bis);
//size of image
int img_width = bufimg.getWidth();
int img_height = bufimg.getHeight();
double scale = (double)maxImageWidth/(double)img_width;
Image sized = getScaledInstanceAWT(bufimg, scale, Image.SCALE_SMOOTH);
//convert image to BufferedImage
BufferedImage resized = toBufferedImage(sized, BufferedImage.TYPE_INT_RGB);
ImageIO.write(resized,"jpeg",bos);
}//try
catch(Exception e){}
}//end
Edited by: webnotick on Apr 13, 2010 12:24 PM
--added a method to the code snippet -- -
Need to Move contents of BLOB from database to middle-tier file system
I need to be able to move the contents of a BLOB (which is a PDF file) from the database to a specified location in the middle-tier file system (running 9iAS). There does not seem to be the equivalent package or other built-in functionality to DBMS_LOB (for moving INTO the database, which is amazing. Does anyone have a java bean or (?) which can accomplish this simingly simple task??
The java bean should work to extract from the database to a binary file on either Unix or Windows. As long as the file is in .bmp format in the database, you can save the file as .bmp on you file system and everything should be alright.
Or, perhaps, am I not understanding your question?
Good Luck
Eric Kamradt -
Convert BLOB from database to string
Hi All,
I have retrieved the blob data from my database , and now i have it in my InvokeVariable. The below details will brief the structure of my output variable.
<variable name="Invoke1_RetrieveRecordForInstanceId_OutputVariable"
messageType="*ns1:RetrieveRecordForInstanceIdOutputCollection_msg*"/>
<wsdl:message name="RetrieveRecordForInstanceIdOutputCollection_msg">
<wsdl:part name="RetrieveRecordForInstanceIdOutputCollection" element="db:RetrieveRecordForInstanceIdOutputCollection"/>
</wsdl:message>
<xs:complexType name="RetrieveRecordForInstanceIdOutputCollection">
<xs:sequence>
<xs:element name="RetrieveRecordForInstanceIdOutput" type="RetrieveRecordForInstanceIdOutput" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RetrieveRecordForInstanceIdOutput">
<xs:sequence>
<xs:element name="INSTANCE_ID" type="xs:decimal" nillable="true"/>
<xs:element name="SOURCE_XML" type="xs:base64Binary" nillable="true"/>
<xs:element name="TARGET_XML" type="xs:base64Binary" nillable="true"/>
</xs:sequence>
</xs:complexType>
I make my assign statement like below.
<assign name="Assign2">
<copy>
<from variable="Invoke1_RetrieveRecordForInstanceId_OutputVariable"
part="RetrieveRecordForInstanceIdOutputCollection"
query="/ns2:RetrieveRecordForInstanceIdOutputCollection/ns2:RetrieveRecordForInstanceIdOutput/ns2:SOURCE_XML"/>
<to variable="EnhancedBLOBdata"/>
</copy>
</assign>
I have my java code for converting the blob to string as below.
String input = (String)getVariableData("*EnhancedBLOBdata*");
Base64Decoder baseDecoder= new Base64Decoder();
try {
byte[] decodedBytes = input.getBytes();
String decoded = new String(decodedBytes);
//String decoded = Base64Decoder.decode(input);
setVariableData("DecodedString", decoded);
catch(Exception ex)
ex.printStackTrace();
The data type of EnhancedBLOBdata is base64Binary.. I also checked with 'string' . Even then i dint get the proper decoded form.
Can anyone help me in using the variable SOURCE_XML coming under the RetrieveRecordForInstanceIdOutputCollection, directly in the line,
String input = (String)getVariableData("*Invoke_Output_Variable....<some format>*");
so that there is no need of assigning to some other variable.. Bcz while assignig i am not sure, the assigned variable contains data in blob format.
Kindly help me in this regard.
Thanks,
Sabarisri. NI have figured out the error happens on a data picture with about 700KB of data all of the other data fields have less than 100KB. Is there a way around this size issue.
-
Convert BLOB from database to XML. - *URGENT*
Hi,
I have converted xml data into BLOB object and inserted into database.
Now when I retrieve the BLOB object,from my DB, using DBadapter, in the invokeOutputVariable, i have the following. This i copied from the 'Flow Trace'
<Invoke1_GetSourceXML_OutputVariable>
<part name="GetSourceXMLOutputCollection" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GetSourceXMLOutputCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/GetSourceXML">
<GetSourceXMLOutput>
<INSTANCE_ID>1</INSTANCE_ID>
*<SOURCE_XML>weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@78f9a</SOURCE_XML>*
<TARGET_XML xsi:nil="true"/>
<ORDER_ID>1</ORDER_ID>
<TASK_INSTANCE_ID>1</TASK_INSTANCE_ID>
<ORDER_DATE xsi:nil="true"/>
<TRANSLATION_TYP_CD xsi:nil="true"/>
<EBM_ID>1</EBM_ID>
<STATUS xsi:nil="true"/>
<STATUS_DETAIL xsi:nil="true"/>
</GetSourceXMLOutput>
</GetSourceXMLOutputCollection>
</part>
</Invoke1_GetSourceXML_OutputVariable>
1) Here i want to confirm, whether we l get weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@78f9a sort of value when we retrieve a BLOB object.
2) Variable declaration is like below.
<variable name="binaryXML" type="xsd:string"/>
<variable name="decodedString" type="xsd:string"/>
binaryXML - value assignment_
<assign name="Assign2">
<copy>
<from variable="Invoke1_GetSourceXML_OutputVariable"
part="GetSourceXMLOutputCollection"
query="/ns2:GetSourceXMLOutputCollection/ns2:GetSourceXMLOutput/ns2:*SOURCE_XML*"/>
<to variable="binaryXML"/>
</copy>
</assign>
I have written java embedding code for converting this BLOB to xml as below
String input = (String)getVariableData("binaryXML");
try
/* *** INITIALLY I TRIED LIKE THIS*** */
//byte[] decodedBytes = Base64Decoder.decode(input.getBytes());
//String decoded = new String(decodedBytes);
//setVariableData("decodedString",decoded);
/* *** MY NEW CODE *** /
String decoded = Base64Decoder.decode(input);
setVariableData("decodedString",decoded);
catch(Exception ex)
ex.printStackTrace();
My Doubt
When I try to write this 'decodedString' to a .txt file, I couldnt find any output there.
<assign name="Assign3">
<copy>
<from variable="decodedString"/>
<to variable="Invoke2_Write_InputVariable" part="body"
query="/ns4:Root/ns4:C1"/>
</copy>
</assign>
Regarding the schema for the file to be written, i tried with 'opaque' schema.. I dint work. Later i tried with the schema as below (which is comma delimited)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://TargetNamespace.com/WriteToFile"
targetNamespace="http://TargetNamespace.com/WriteToFile"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
nxsd:version="NXSD"
nxsd:stream="chars"
nxsd:encoding="US-ASCII"
>
<xsd:element name="Root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="C1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Kindly help me in ths regard.
Thanks,
Sabarisri. N
Edited by: Sabarisri N on Jul 22, 2011 2:37 PMRead this :
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14252/adx_j_xsu.htm#sthref508 -
Write blob data from database to unix server
Hi all,
I need to send the attachment file into the mail. I have a header form in which I have implemented Download/Upload functionality using Apex user guide. When ever a user fill all the entries and submit the form then some field information along with attachment I need to send to the user.
I mean when ever user hit the submit button it should take blob data from my custom table tmp_downlod_files and send to the user as an attachment.
I have searched the post and got lot information but not able to get succeed.
I have implemented java stored procedure for sending automatic mail when user is submitting the form but what I need is to take blob content from database and send as an attachment.
1: So I need to write blob content from custom table to unix server in some location and from there I need to attach that file.
2: the java store which I have implemented for sending automatic mail is working and one argument is attachment which I am passing null for now. So mail is working how to write the file from database to unix server and send as an attachment.
What I did for writing file from database to unix server:
1:
CREATE OR REPLACE PROCEDURE trx_blob_to_file (l_header_id IN NUMBER)
IS
BEGIN
FOR rec_picture IN (SELECT ID
FROM TMP.tpx_download_files
WHERE header_id = l_header_id
AND mime_type LIKE ('image' || '%'))
LOOP
DECLARE
l_out_file UTL_FILE.file_type;
l_buffer RAW (32767);
l_amount BINARY_INTEGER := 32767;
l_pos INTEGER := 1;
l_blob_len INTEGER;
p_data BLOB;
file_name VARCHAR2 (256);
BEGIN
SELECT blob_content, filename
INTO p_data, file_name
FROM tpx_download_files
WHERE ID = rec_picture.ID;
l_blob_len := DBMS_LOB.getlength (p_data);
l_out_file :=
UTL_FILE.fopen ('/home/oracle/interfaces/out/upld',
file_name,
'wb',
32767
WHILE l_pos < l_blob_len
LOOP
DBMS_LOB.READ (p_data, l_amount, l_pos, l_buffer);
IF l_buffer IS NOT NULL
THEN
UTL_FILE.put_raw (l_out_file, l_buffer, TRUE);
END IF;
l_pos := l_pos + l_amount;
END LOOP;
UTL_FILE.fclose (l_out_file);
EXCEPTION
WHEN OTHERS
THEN
IF UTL_FILE.is_open (l_out_file)
THEN
UTL_FILE.fclose (l_out_file);
END IF;
END;
END LOOP;
END;
2: I have written a PL/SQL process and calling the above procedure on SUBMIT:
DECLARE
l_header_id NUMBER;
l_filename VARCHAR2 (200);
BEGIN
SELECT header_id, filename
INTO l_header_id, l_filename
FROM tpx_download_files
WHERE header_id = :p35_sr_header_id;
trx_blob_to_file (l_header_id);
END;
But it is not writing the file from database to unix server.
If I can get how to make working to write file from database to unix server then I will hopefully can send an attachment.
3; I have given
GRANT EXECUTE ON TPX_BLOB_TO_FILE TO PUBLIC.
And
GRANT EXECUTE ON UTL_FILE TO PUBLIC.
Where I am doing wroung can anyone guide me or any other approach is appreciated.
I am already late so I need soon. Please help.Hi all,
I need to send the attachment file into the mail. I have a header form in which I have implemented Download/Upload functionality using Apex user guide. When ever a user fill all the entries and submit the form then some field information along with attachment I need to send to the user.
I mean when ever user hit the submit button it should take blob data from my custom table tmp_downlod_files and send to the user as an attachment.
I have searched the post and got lot information but not able to get succeed.
I have implemented java stored procedure for sending automatic mail when user is submitting the form but what I need is to take blob content from database and send as an attachment.
1: So I need to write blob content from custom table to unix server in some location and from there I need to attach that file.
2: the java store which I have implemented for sending automatic mail is working and one argument is attachment which I am passing null for now. So mail is working how to write the file from database to unix server and send as an attachment.
What I did for writing file from database to unix server:
1:
CREATE OR REPLACE PROCEDURE trx_blob_to_file (l_header_id IN NUMBER)
IS
BEGIN
FOR rec_picture IN (SELECT ID
FROM TMP.tpx_download_files
WHERE header_id = l_header_id
AND mime_type LIKE ('image' || '%'))
LOOP
DECLARE
l_out_file UTL_FILE.file_type;
l_buffer RAW (32767);
l_amount BINARY_INTEGER := 32767;
l_pos INTEGER := 1;
l_blob_len INTEGER;
p_data BLOB;
file_name VARCHAR2 (256);
BEGIN
SELECT blob_content, filename
INTO p_data, file_name
FROM tpx_download_files
WHERE ID = rec_picture.ID;
l_blob_len := DBMS_LOB.getlength (p_data);
l_out_file :=
UTL_FILE.fopen ('/home/oracle/interfaces/out/upld',
file_name,
'wb',
32767
WHILE l_pos < l_blob_len
LOOP
DBMS_LOB.READ (p_data, l_amount, l_pos, l_buffer);
IF l_buffer IS NOT NULL
THEN
UTL_FILE.put_raw (l_out_file, l_buffer, TRUE);
END IF;
l_pos := l_pos + l_amount;
END LOOP;
UTL_FILE.fclose (l_out_file);
EXCEPTION
WHEN OTHERS
THEN
IF UTL_FILE.is_open (l_out_file)
THEN
UTL_FILE.fclose (l_out_file);
END IF;
END;
END LOOP;
END;
2: I have written a PL/SQL process and calling the above procedure on SUBMIT:
DECLARE
l_header_id NUMBER;
l_filename VARCHAR2 (200);
BEGIN
SELECT header_id, filename
INTO l_header_id, l_filename
FROM tpx_download_files
WHERE header_id = :p35_sr_header_id;
trx_blob_to_file (l_header_id);
END;
But it is not writing the file from database to unix server.
If I can get how to make working to write file from database to unix server then I will hopefully can send an attachment.
3; I have given
GRANT EXECUTE ON TPX_BLOB_TO_FILE TO PUBLIC.
And
GRANT EXECUTE ON UTL_FILE TO PUBLIC.
Where I am doing wroung can anyone guide me or any other approach is appreciated.
I am already late so I need soon. Please help. -
Display BLOB from remote database
Context: We are offloading documents (pdf) from our OLTP database to a dedicated 'output database.' These documents must be displayed from the application on our OLTP database using a database link. Various posts show that querying a BLOB from a remote database can best be implemented using a query on the remote table and an insert on a local (temporary) table. So far, so good. The idea is to display this BLOB using wpg_docload.download_file.
BUT:
When trying to display the pdf from this global temporary table an error occurs:
ORA-14453: attempt to use a LOB of a temporary table, whose data has already been purged
When trying to display from a normal table and issuing a rollback after wpg_docload.download_file results in another error:
ORA-22922: nonexistent LOB value
When trying to display from a normal table and not removing the record in any way, its works fine. Only I now have a garbage collection issue, because the remote date remain in my local (preferably temporary) table.
It seems to me that mod_plsql needs an active session to display my pdf.
Does anyone have an explanation for this behaviour and maybe a solution for my problem?
Environment:
local: 10.2.0.4.0
remote: 11.1.0.7.0
pdf size: ca. 150kB
code used:
PROCEDURE show_doc (p_nta_id IN NUMBER
,p_sessie IN NUMBER
IS
t_lob BLOB;
t_lob2 BLOB := empty_blob();
t_mime VARCHAR2(100);
BEGIN
-- copy BLOB into local global temp table
INSERT INTO mvs_tmp_notaprint_bestanden
npv_nta_id
, npv_npe_sessie
, mime_type
, bestand
) -- from remote table
SELECT npd.npv_nta_id
,npd.npv_npe_sessie
,npd.mime_type
,npd.bestand
FROM mvs_notaprint_bestanden@marc npd
WHERE npd.npv_nta_id ; = p_nta_id
AND npd.npv_npe_sessie = p_sessie
-- show BLOB from local global temp table
SELECT t.bestand
, t.mime_type
INTO t_lob
, t_mime
FROM mvs_tmp_notaprint_bestanden t
WHERE t.npv_nta_id ; = p_nta_id
AND t.npv_npe_sessie ; = p_sessie
t_lob2 := t_lob; -- buffer BLOB
owa_util.mime_header(t_mime , FALSE );
owa_util.http_header_close;
wpg_docload.download_file(t_lob2);
END show_doc;Andrew,
thank you, the 'preserve rows' did the trick.
Every query from a browser (even in the same browser session) is a new Oracle session, so the copied records in the global temporary table are gone after the page is displayed.
Am I correct in assuming that each call from the browser results in a new Oracle session? I did a few tests and found for each call a different sessionid.
Sincerly,
Arne Suverein
Edited by: Arne Suverein on Aug 18, 2009 3:35 PM -
Image upload and display from database blob coloumn in ADF
HI
how can i upload and display image from database ( blob ) coloumn in ADFHi,
Take a look to this video: http://www.youtube.com/watch?v=_KYquJwYFGE
AP -
"Create Application from Database" and BLOB type
Hi all,
I see many threads about BLOB type but my question is related to the Flex Builder built-in feature "Create Application from Database".
Is there a way or a sw version to automatically use MySQL BLOB types when creating a PHP/database application?
Thank you!Hi Dave,
Would you please file a bug with all the necessary details
regarding this issue? The bug base is found at:
http://bugs.adobe.com/jira.
We’ll look into this. Thank you for letting us know!
Lacra -
Extract data from database tables and download in pdf and csv
extract data from database tables and download in pdf and csv
hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
the form code is
function merge_header3 return varchar2 is
begin
return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
end;
procedure download_file (i_pbat integer) is
dir varchar2(80);
file_name1 varchar2(80);
file_name2 varchar2(80);
appl_code varchar2(80);
fil1 client_text_io.file_type;
fil2 client_text_io.file_type;
dat varchar2(1000);
DATA VARCHAR2(1000);
bvspro varchar2(100);
ssch varchar2(100);
bvspro_total number(20,2);
ssch_total number(20,2);
grand_total number(20,2);
cnt integer;
cursor pbat is
select *
from sms_payment_batches
where id = i_pbat
cursor pay (pb_id integer) is
select *
from sms_payment_vw
where pbat_id = pb_id
order by subsidy ASC,programme,beneficiary_name
cursor cgref (low varchar2) is
select *
from cg_ref_codes
where rv_domain ='SMS'
and rv_low_value = low
success boolean;
begin
set_application_property(cursor_style,'busy');
appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
dir := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
success := webutil_file.create_directory(dir);
if webutil_file.file_is_directory(dir) then
null;
-- message ('directory exists');
else
-- message ('create directory ');
success := webutil_file.create_directory(dir);
-- if success then message ('directory exists'); end if;
end if;
for c_pbat in pbat loop
file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
--message('create files ');
-- fil1 := client_text_io.fopen (file_name1,'W');
-- fil2 := client_text_io.fopen (file_name2,'W');
fil1 := client_text_io.fopen (file_name1,'W','');
fil2 := client_text_io.fopen (file_name2,'W','');
dat := 'FROM ACCOUNT NUMBER'
||'~'||'FROM ACCOUNT DESCRIPTION'
||'~'||'MY STATEMENT DESCRIPTION'
||'~'||'BENEFICIARY ACCOUNT NUMBER'
||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'
||'~'||'BENEFICIARY BRANCH CODE'
||'~'||'BENEFICIARY NAME'
||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
||'~'||'AMOUNT';
-- client_text_io.put_line(fil1,dat);
bvspro:= null;
ssch := null;
cnt := 0;
dat := '~'||lpad('~',16,'~');
for c_pay in pay(c_pbat.id) loop
--message('cpay loop ' || cnt);
if bvspro is null then
dat := lpad('~',16,'~');
dat := utility.put_field(1,c_pay.programme,dat,'~');
client_text_io.put_line(fil2,dat);
dat := utility.put_field(1,c_pay.subsidy,dat,'~');
client_text_io.put_line(fil2,dat);
dat := merge_header3;
client_text_io.put_line(fil2,dat);
bvspro := c_pay.programme;
ssch := c_pay.subsidy;
grand_total := 0;
bvspro_total := 0;
ssch_total := 0;
end if;
if bvspro <> c_pay.programme then
dat := lpad('~',16,'~');
dat := utility.put_field(5,ssch_total,dat,'~');
dat := lpad('~',16,'~');
dat := utility.put_field(5,bvspro_total,dat,'~');
dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
client_text_io.put_line(fil2,dat);
dat := lpad('~',16,'~');
client_text_io.put_line(fil2,dat);
dat := utility.put_field(1,c_pay.programme,dat,'~');
client_text_io.put_line(fil2,dat);
bvspro := c_pay.programme;
dat := utility.put_field(1,c_pay.subsidy,dat,'~');
client_text_io.put_line(fil2,dat);
dat := merge_header3;
client_text_io.put_line(fil2,dat);
bvspro := c_pay.programme;
ssch := c_pay.subsidy;
bvspro_total := 0;
ssch_total := 0;
cnt :=0;
end if;
if ssch <> c_pay.subsidy then
dat := lpad('~',16,'~');
dat := utility.put_field(5,ssch_total,dat,'~');
dat := lpad('~',16,'~');
client_text_io.put_line(fil2,dat);
dat := utility.put_field(1,c_pay.subsidy,dat,'~');
client_text_io.put_line(fil2,dat);
dat := merge_header3;
client_text_io.put_line(fil2,dat);
ssch := c_pay.subsidy;
ssch_total := 0;
cnt :=0;
end if;
bvspro_total := bvspro_total + c_pay.amount;
ssch_total := ssch_total + c_pay.amount;
grand_total := grand_total + c_pay.amount;
cnt := cnt +1;
--message('bfore write file 2 ' );
client_text_io.put_line(fil2
,cnt
||'~'|| c_pay.beneficiary_name
||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''
||'~'||c_pay.BRANCH_CODE ||''
||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC
||'~'|| c_pay.AMOUNT
||'~'|| c_pay.address_line1
||'~'|| c_pay.address_line2
||'~'|| c_pay.postal_code
||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
||'~'|| c_pay.month
||'~'|| c_pay.bank
||'~'|| c_pay.bank_branch
||'~'|| c_pay.account_type
||'~'|| c_pay.subsidy
||'~'|| c_pay.programme)
DATA := c_pay.FROM_ACCOUNT_NUMBER
||'~'||c_pay.FROM_ACCOUNT_DESCR
||'~'||c_pay.MY_STATEMENT_DESCR
||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
||'~'
||'~'||c_pay.BRANCH_CODE
||'~'||c_pay.BENEFICIARY_NAME
||'~'||c_pay.BENEFICIARY_STATEMENT_DESC
||'~'||c_pay.AMOUNT;
DATA := REPLACE(DATA, ',' , ' ' );
DATA := REPLACE(DATA, '~' , ',' );
--message (cnt ||' ' || data);
--message('bfore write file 1 ' );
client_text_io.put_line(fil1, data);
end loop;
--message ('end of write');
dat := lpad('~',16,'~');
dat := utility.put_field(6,ssch_total,dat,'~');
dat := lpad('~',16,'~');
dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
dat := utility.put_field(5,bvspro_total,dat,'~');
client_text_io.put_line(fil2,dat);
dat := lpad('~',16,'~');
client_text_io.put_line(fil2,dat);
dat := utility.put_field(1,'Grand Total:' ,dat,'~');
dat := utility.put_field(5,grand_total,dat,'~');
client_text_io.put_line(fil2,dat);
-- close file
for i in 1..50 loop
if substr(i,-1) = 0 then
message ('flush ' || i);
end if;
client_text_io.put_line(fil1, lpad(' ',2000));
client_text_io.put_line(fil2, lpad(' ',2000));
client_text_io.put_line(fil1, lpad(' ',2000));
client_text_io.put_line(fil2, lpad(' ',2000));
end loop;
client_text_io.fclose(fil1);
client_text_io.fclose(fil2);
end loop;
set_application_property(cursor_style,'default');
exception
when others then
message(sqlcode ||' ' ||sqlerrm);
end download_file; i try this but this code onlydownload image not data from database tables
public void downloadImage(FacesContext facesContext, OutputStream outputStream)
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
// get an ADF attributevalue from the ADF page definitions
AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
if (attr == null)
return;
// the value is a BlobDomain data type
BlobDomain blob = (BlobDomain) attr.getInputValue();
try
{ // copy the data from the BlobDomain to the output stream
IOUtils.copy(blob.getInputStream(), outputStream);
// cloase the blob to release the recources
blob.closeInputStream();
// flush the output stream
outputStream.flush();
catch (IOException e)
// handle errors
e.printStackTrace();
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
FacesContext.getCurrentInstance().addMessage(null, msg);
}You should ask your forum in the ADF-forum.
-
Hi,
I have a table in database that has files uploaded from front-end like XLS, DOC, PDF,TXt etc.
I need to create a report that shows the filename as hyperlink and when user clicks the link, it should open the attachment in Excel if .XLS, Adobe if .PDF ..
Ex: Filename
Test.xls
plan.Pdf
roadmap.doc
Where all entries under "Filename" column is hyperlink and when user clicks hyperlink, it opens the appropriate document
Can we get this done in BI Publisher out of the box or do we need any custom code?
Advance thanks to everyone for their valuable feedback.
Edited by: S00000 on Sep 14, 2012 12:15 PMok
>
I have a table in database that has files uploaded from front-end like XLS, DOC, PDF,TXt etc.
>
in my humble opinion it's not good solution
why in table? why not use bfile?
if you want select blob from your table you must always download it to some directory on server in sql/plsql way
or if you use, as example, c#client then you can download it as byte stream to client side
if you use bfile then your file stored on some server directory and you can work with by ftp, http as for ebs sample
so in this case you can't have problem with attachment, you can use url+filename in your report
--add
>
Iam looking for a solution where I can show attachments in BIP report from Database directly.
>
i not sure as it looks like
one big report with embedded many other files?
or how?
Edited by: AlexAnd on Sep 19, 2012 11:21 PM -
Not able to download image from database
not able to download image from database am in jdeveloper 11g release 2 am using this example
: http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
hi am not able to down load my image my jsp xml is
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document title="sms4200.jspx" id="d1">
<af:messages id="m1"/>
<af:form id="f1" usesUpload="true">
<af:panelStretchLayout topHeight="211px" id="psl1" inlineStyle="width:1338px; background-color:Navy;">
<f:facet name="top">
<af:panelHeader text="Sms Intergration Sources" id="ph1">
<f:facet name="context"/>
<f:facet name="menuBar"/>
<f:facet name="toolbar"/>
<f:facet name="legend"/>
<f:facet name="info"/>
<af:panelStretchLayout id="psl2" inlineStyle="height:178px; width:1018px;" topHeight="22px"
endWidth="589px" startWidth="55px" bottomHeight="33px">
<f:facet name="end">
<af:panelHeader text="Office" id="ph2"
inlineStyle="width:900px; background-color:Navy;">
<f:facet name="context"/>
<f:facet name="menuBar"/>
<f:facet name="toolbar"/>
<f:facet name="legend"/>
<f:facet name="info"/>
<af:panelFormLayout id="pfl3" inlineStyle="background-color:Navy;" rows="1">
<f:facet name="footer"/>
<af:inputText label="#{bindings.Name1.hints.label}"
required="#{bindings.Name1.hints.mandatory}"
columns="20"
maximumLength="#{bindings.Name1.hints.precision}"
shortDesc="#{bindings.Name1.hints.tooltip}" id="it2">
<f:validator binding="#{bindings.Name1.validator}"/>
</af:inputText>
<af:inputText
label="#{bindings.LocalUpDirectory1.hints.label}"
required="#{bindings.LocalUpDirectory1.hints.mandatory}"
columns="20"
maximumLength="#{bindings.LocalUpDirectory1.hints.precision}"
shortDesc="#{bindings.LocalUpDirectory1.hints.tooltip}"
id="it3">
<f:validator binding="#{bindings.LocalUpDirectory1.validator}"/>
</af:inputText>
</af:panelFormLayout>
</af:panelHeader>
</f:facet>
<f:facet name="top">
<af:inputText value="#{bindings.IntegrationTypeName1.inputValue}"
label="#{bindings.IntegrationTypeName1.hints.label}"
required="#{bindings.IntegrationTypeName1.hints.mandatory}"
columns="#{bindings.IntegrationTypeName1.hints.displayWidth}"
maximumLength="#{bindings.IntegrationTypeName1.hints.precision}"
shortDesc="#{bindings.IntegrationTypeName1.hints.tooltip}" id="it1">
<f:validator binding="#{bindings.IntegrationTypeName1.validator}"/>
</af:inputText>
</f:facet>
</af:panelStretchLayout>
</af:panelHeader>
</f:facet>
<f:facet name="center">
<!-- id="af_one_column_header_stretched" -->
<af:decorativeBox theme="dark" id="db1" inlineStyle="width:1050px; background-color:Navy;">
<f:facet name="center">
<af:panelGroupLayout layout="scroll" id="pgl3" inlineStyle="background-color:Navy;">
<af:panelStretchLayout id="psl3" inlineStyle="width:1012px; height:502px;"
topHeight="133px" startWidth="0px">
<f:facet name="center">
<af:panelStretchLayout id="psl5" endWidth="659px" startWidth="171px">
<f:facet name="center"/>
<f:facet name="start"/>
<f:facet name="end">
<af:panelGroupLayout layout="scroll" id="pgl2">
<af:inputFile label="Select Image" id="if1" autoSubmit="true"
valueChangeListener="#{ImageBean.uploadFileValueChangeEvent}"/>
<af:commandButton actionListener="#{bindings.CreateInsert.execute}"
text="Restart Load Image Process"
disabled="#{!bindings.CreateInsert.enabled}"
id="cb2"/>
<af:commandButton actionListener="#{bindings.Commit.execute}"
text="Save"
disabled="#{!bindings.Commit.enabled}"
id="cb3"/>
<af:commandButton text="View" id="cb1"
partialSubmit="true"
unsecure="#{ImageBean.downloadButton}"
action="#{image.downloadImage}"
binding="#{image2.downloadButton}"/>
</af:panelGroupLayout>
</f:facet>
<f:facet name="top"/>
</af:panelStretchLayout>
</f:facet>
<f:facet name="start"/>
<f:facet name="top">
<af:panelStretchLayout id="psl4" startWidth="232px" endWidth="296px"
bottomHeight="18px" topHeight="11px">
<f:facet name="bottom"/>
<f:facet name="center"/>
<f:facet name="start">
<af:panelFormLayout id="pfl1" labelAlignment="top">
<f:facet name="footer"/>
<af:inputText label="File from PC to be Transfered" id="it4"/>
</af:panelFormLayout>
</f:facet>
<f:facet name="end">
<af:panelFormLayout id="pfl2" labelAlignment="top" maxColumns="10">
<f:facet name="footer">
<af:inputText value="#{bindings.DocumentName.inputValue}"
label="File Transfered to Database"
required="#{bindings.DocumentName.hints.mandatory}"
columns="50"
rows="1"
maximumLength="#{bindings.DocumentName.hints.precision}"
shortDesc="#{bindings.DocumentName.hints.tooltip}"
id="it5" simple="false">
<f:validator binding="#{bindings.DocumentName.validator}"/>
</af:inputText>
</f:facet>
</af:panelFormLayout>
</f:facet>
<f:facet name="top"/>
</af:panelStretchLayout>
</f:facet>
</af:panelStretchLayout>
</af:panelGroupLayout>
</f:facet>
</af:decorativeBox>
</f:facet>
</af:panelStretchLayout>
</af:form>
</af:document>
</f:view>
</jsp:root>
and my log file is
<ViewHandlerImpl> <_checkTimestamp> Apache Trinidad is running with time-stamp checking enabled. This should not be used in a production environment. See the org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in WEB-INF/web.xml
<UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
the method am calling is
public BlobDomain downloadImage() {
FacesContext facesContext = null;
OutputStream outputStream = null;
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
// get an ADF attributevalue from the ADF page definitions
AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("Documentimage");
if (attr == null) {
return null;
// the value is a BlobDomain data type
BlobDomain blob = (BlobDomain)attr.getInputValue();
try { // copy hte data from the BlobDomain to the output stream
IOUtils.copy(blob.getInputStream(), outputStream);
// cloase the blob to release the recources
blob.closeInputStream();
// flush the outout stream
outputStream.flush();
} catch (IOException e) {
// handle errors
e.printStackTrace();
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
FacesContext.getCurrentInstance().addMessage(null, msg);
return blob;
}i get this error when clicking the button
error when not able to download image
<BeanHandler> <getStructure> Failed to build StructureDefinition for : sms4200.ImageBean
<UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
Edited by: Tshifhiwa on 2012/06/03 10:53 AM
Edited by: Tshifhiwa on 2012/06/03 10:56 AM
Edited by: Tshifhiwa on 2012/06/03 10:57 AMhi i try to run your sample am geting this error
Error 500--Internal Server Error
oracle.jbo.DMLException: JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/HRDS
at oracle.jbo.server.DBTransactionImpl.lookupDataSource(DBTransactionImpl.java:1453)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:329)
at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:600)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:417)
at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:8972)
at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4606)
at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2536)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2346)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3245)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:571)
at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:234)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:504)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:499)
at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:517)
at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:867)
at oracle.adf.model.binding.DCDataControl.setErrorHandler(DCDataControl.java:487)
at oracle.jbo.uicli.binding.JUApplication.setErrorHandler(JUApplication.java:261)
at oracle.adf.model.BindingContext.put(BindingContext.java:1318)
at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:247)
at oracle.adf.model.BindingContext.instantiateDataControl(BindingContext.java:1020)
at oracle.adf.model.dcframe.DataControlFrameImpl.doFindDataControl(DataControlFrameImpl.java:1645)
at oracle.adf.model.dcframe.DataControlFrameImpl.internalFindDataControl(DataControlFrameImpl.java:1514)
at oracle.adf.model.dcframe.DataControlFrameImpl.findDataControl(DataControlFrameImpl.java:1474)
at oracle.adf.model.BindingContext.internalFindDataControl(BindingContext.java:1150)
at oracle.adf.model.BindingContext.get(BindingContext.java:1103)
at oracle.adf.model.binding.DCParameter.evaluateValue(DCParameter.java:82)
at oracle.adf.model.binding.DCParameter.getValue(DCParameter.java:111)
at oracle.adf.model.binding.DCBindingContainer.getChildByName(DCBindingContainer.java:2748)
at oracle.adf.model.binding.DCBindingContainer.internalGet(DCBindingContainer.java:2796)
at oracle.adf.model.binding.DCExecutableBinding.get(DCExecutableBinding.java:115)
at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:329)
at oracle.adf.model.binding.DCBindingContainer.evaluateParameterWithElCheck(DCBindingContainer.java:1478)
at oracle.adf.model.binding.DCBindingContainer.findDataControl(DCBindingContainer.java:1608)
at oracle.adf.model.binding.DCIteratorBinding.initDataControl(DCIteratorBinding.java:2542)
at oracle.adf.model.binding.DCIteratorBinding.getDataControl(DCIteratorBinding.java:2477)
at oracle.adf.model.binding.DCIteratorBinding.getAttributeDefs(DCIteratorBinding.java:3319)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.fetchAttrDefs(JUCtrlValueBinding.java:514)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDefs(JUCtrlValueBinding.java:465)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(JUCtrlValueBinding.java:541)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(JUCtrlValueBinding.java:531)
at oracle.jbo.uicli.binding.JUCtrlValueBinding$1JUAttributeDefHintsMap.(JUCtrlValueBinding.java:4104)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeHintsMap(JUCtrlValueBinding.java:4211)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.getHints(JUCtrlValueBinding.java:2564)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:2389)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlAttrsBinding.internalGet(FacesCtrlAttrsBinding.java:275)
at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:749)
at javax.el.MapELResolver.getValue(MapELResolver.java:164)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(Unknown Source)
at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:73)
at oracle.adfinternal.view.faces.renderkit.rich.LabelLayoutRenderer.getLabel(LabelLayoutRenderer.java:929)
at oracle.adfinternal.view.faces.renderkit.rich.LabelLayoutRenderer.encodeAll(LabelLayoutRenderer.java:213)
at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.encodeAll(LabeledInputRenderer.java:215)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:1088)
at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:50)
at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1604)
at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1523)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:420)
at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:208)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:447)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$1500(PanelGroupLayoutRenderer.java:30)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:734)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:637)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:360)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.access$400(RegionRenderer.java:50)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer$ChildEncoderCallback.processComponent(RegionRenderer.java:707)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer$ChildEncoderCallback.processComponent(RegionRenderer.java:692)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:297)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:186)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:323)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1277)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: javax.naming.NameNotFoundException: While trying to lookup 'jdbc.HRDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/HRDS'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at oracle.jbo.server.DBTransactionImpl.lookupDataSource(DBTransactionImpl.java:1439)
... 190 more
my connection.xml is
<?xml version = '1.0' encoding = 'UTF-8'?>
<References xmlns="http://xmlns.oracle.com/adf/jndi">
<Reference name="HRDS" className="oracle.jdeveloper.db.adapter.DatabaseProvider" credentialStoreKey="HRDS" xmlns="">
<Factory className="oracle.jdeveloper.db.adapter.DatabaseProviderFactory"/>
<RefAddresses>
<StringRefAddr addrType="sid">
<Contents>smsdev</Contents>
</StringRefAddr>
<StringRefAddr addrType="subtype">
<Contents>oraJDBC</Contents>
</StringRefAddr>
<StringRefAddr addrType="port">
<Contents>1521</Contents>
</StringRefAddr>
<StringRefAddr addrType="hostname">
<Contents>localhost</Contents>
</StringRefAddr>
<StringRefAddr addrType="user">
<Contents>hr</Contents>
</StringRefAddr>
<SecureRefAddr addrType="password"/>
<StringRefAddr addrType="oraDriverType">
<Contents>thin</Contents>
</StringRefAddr>
</RefAddresses>
</Reference>
</References>
Edited by: Tshifhiwa on 2012/06/04 2:20 PM
Maybe you are looking for
-
My ipod is connected to the computer but not shown in itunes
so i hooked my ipod nano 4gb to my computer and it says do not disconnect on the screen. also the owner ipod is not showin in itunes player what should i do.
-
Mini Bridge "Waiting for Bridge" error Macintosh
We'd been having this error on a couple of our computers and none of the steps in the KB article http://helpx.adobe.com/photoshop/kb/error-waiting-for-bridge-cs5.html are working. We initally set up one computer to be used as our master image. Once w
-
How do I save internet article/info to read when not connected to Internet?
Re iPad mini ios7: I do not have internet at home, & want to save articles/info/book pages etc while connected to I WiFi in public place, to read when not connected at home. Have tried ''add to home screen' , 'add to reading list', & 'bookmark''
-
Need help connecting a MS Sql Database in CF Administrator
Good morning, I`m hoping someone out there can help me. I simply want to add a MS SQL datasource within Coldfusion Administrator. I have connected to it successfully with Sql Server Management Studio, using Windows Authentication. I`m assuming I need
-
Changing an Attribute Dimension Hierarchy
I've had problems changing custom attribute hierarchies and I'm wondering if others have had similar problems and have a way to get around this. I have an attribute (Program) of my entity field that currently looks like: Program Finance P10001 P1000