Originally posted by kanthi84
How do i get clob data using java and assign to a variable
Collapse
X
-
If you are sure that's the line throwing the nullpointer exception then check your value of con. It could be the one that is null at the time of call. Where are you getting it from?Originally posted by kanthi84THE EXCEPTION IS GETTING AFTER THE FOLLOWING LINE
oracle.sql.CLOB newClob =oracle.sql.CLO B.createTempora ry(con, false, oracle.sql.CLOB .DURATION_CALL) ;
AFTER THIS LINE,ST.CLOSE() IS EXCECUTED AND EXCEPTION IS DISPLAYEDComment
-
private void Details(String A,String B,String C,String D)
{
Clob tempClob = null;
try
{
con=DBConnectio n.getConnection ();
pstmt=con.prepa reStatement("IN SERT INTO TABLE values('','"+A+ "','',EMPTY_CLO B(),'"+B+"','"+ D+"','')");
tempClob = (Clob) oracle.sql.CLOB .createTemporar y(con, false,oracle.sq l.CLOB.DURATION _SESSION);
((oracle.sql.CL OB) tempClob).putSt ring(1, C);
pstmt.setClob(4 , tempClob);
pstmt.executeUp date();
}
catch(SQLExcept ion e)
{
System.out.prin tln("Getting the item ParentID:"+e);
}
catch(Exception e)
{
System.out.prin tln("Getting the item ParentID:"+e);
}
finally
{
try{
pstmt.close();
st.close();
con.close();
}catch(SQLExcep tion e)
{
System.out.prin tln(e);
}
}
}Comment
Comment