Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Problmes in Inserting data with clob or blob with java into oracle
I am getting problems when inserting data into blob.
import oracle.jdbc.driver.OracleResultSet; import oracle.jdbc.driver.*; import oracle.sql.*; import java.sql.*; import oracle.sql.BLOB; public class clob4 { public static void main (String args []) { try{ DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn =DriverManager.getConnection
("jdbc:oracle:thin:@delhi:1521:srin","chitra","chitra"); System.out.println("Connection created");
Statement st=conn.createStatement(); st.execute("insert into venkat values('row1',empty_blob())"); System.out.println("Row is inserted"); String cmd="select * from venkat where value='row1'"; ResultSet rs=st.executeQuery(cmd); BLOB clobv=((OracleResultSet)rs).getBLOB(1); System.out.println("The clobv value is "+clobv); }catch(Exception e){e.printStackTrace();} } }
The errors are:
The method oracle.jdbc2.Blob getBlob(int) declared in class oracle.jdbc.driver.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.
could anybody give the solution Thanks in advance. Venkat. venkatrao10_at_usa.net
![]() |
![]() |