java.sql.SQLException : General error
Hi every body,
Once i compile my jdbc program i am getting an General error
I created a table and an attachment to oracle database using jdbc, worked well ,now my question is once i thought to read that attachment in a local disk i am getting this error.
Can any one plz come up with solution
My code as follows
import java.sql.*;
import java.io.*;
public class Sampleread {
public static void main(String args[])throws SQLException
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn=DriverManager.getConnection("jdbc:odbc:oracledsn","scott","tiger");
Statement st=cn.createStatement();
ResultSet rs=st.executeQuery("Select * from Sample");
rs.next();
//System.out.println("Before");
InputStream is=rs.getBinaryStream("text");
//System.out.println("After" +is);
FileOutputStream fos=new FileOutputStream("c:/ram/xyz.xml");
BufferedOutputStream bos=new BufferedOutputStream(fos);
int a;
while((a=is.read())!=-1)
{
bos.write(a);
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
regards
thanks in advance
ramkoil

