|
I used the following code to download and the process did not report an error
But the downloaded stuff is always 86 bytes, and it is always garbled when opened. Why is this?
Please help .. thanks
Class.forName ("oracle.jdbc.driver.OracleDriver"). NewInstance ();
String url = "jdbc: oracle: thin: @ 192.168.31.109: 1521: iasdb";
// orcl is the SID of your database
String user = "news";
String password = "up722006";
String name = "xxx";
Connection conn = DriverManager.getConnection (url, user, password);
PreparedStatement st = conn.prepareStatement ("select up_file from test where name =?");
st.setString (1, name);
// ResultSet rs = st.executeQuery ();
ResultSet rs = st.executeQuery ();
if (rs.next ())
{
byte [] cnt = rs.getBytes ("up_file");
System.out.print ("here");
response.getOutputStream (). write (cnt);
System.out.print ("hehe");
}
} |
|