cancel
Showing results for 
Search instead for 
Did you mean: 

Download files form oracle database in WD?

Former Member
0 Kudos

Hello all,

I have a scenario like:

I have stored the flat files in the Oracled table with the BLOB concept.

How to download the blob objects in web dynpro?

PLease help regarding this.

Regards,

CSP

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi

good

check this code

Ask your system Admin for servername,portnumber of database server

Connection conn=null;

try {

Class.forName("oracle.jdbc.driver.OracleDriver");

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

conn =DriverManager.getConnection ("jdbc:oracle:thin:@<servername>:<portnumber>:DB","uname", "pwd");

Statement stmt=conn.createStatement();

ResultSet rs=stmt.executeQuery("select * from <tablename>"); // select statment

while(rs.next())

{

IXXElement nodeConnection=wdContext.createXXElement(); //creating a node to store the data from oracle

nodeConnection.setYY(rs.getInt("YY")); // setting the values into input fields

nodeConnection.setAA(rs.getInt("AA"));

nodeConnection.setBB(rs.getInt("BB"));

...

...

..

wdContext.nodeXX().addElement(nodeConnection); // adding the node

}

}

catch(Exception ex)

{

}

finally

{

try

{

conn.close(); // closing the connection

}

catch(Exception e)

{

}

}

check this link too

https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&pageid=47055

thanks

mrutyun^

Former Member
0 Kudos

Hi

Following is the way to proceed

Connection con= // Connection to the Oracle Db

Statement st=con.createStatement();

ResultSet rs = st.executeQuery("SELECT <Your Col> FROM SDN_USERS");

while(rs.next())

{

byte[] b=rs.getBytes(2);

IWDResource res=WDResourceFactory.createCachedResource(b,"Txt",WDWebResourceType.TXT);

bind this <b>res</b> to an attribute of type Binary in the context

}

Regards

Ayyapparaj

Former Member
0 Kudos

hi,

For this you need a web-service which will read the binary data of your file from the blob column. Then this you can convert it to the byte[] and consume it at WD side using models.

thanks & regards,

Manoj