on 11-14-2007 4:57 AM
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
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^
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.