Does anyone have a code snippet to show how to populate the Clob in the first
place?
Thanks,
Cully.
Settings from weblogic.properties:
weblogic.jdbc.connectionPool.oraclePoolCSA=\
url=jdbc:oracle:thin:@IHP273:1521:AIRCORE,\
driver=oracle.jdbc.driver.OracleDriver,\
loginDelaySecs=1,\
initialCapacity=1,\
maxCapacity=2,\
capacityIncrement=2,\
allowShrinking=true,\
shrinkPeriodMins=15,\
refreshMinutes=10,\
testTable=dual,\
props=user=csav2;password=csav2
weblogic.allow.reserve.weblogic.jdbc.connectionPool.oraclePoolCSA=\
guest,everyone
weblogic.allow.reset.weblogic.jdbc.connectionPool.oraclePoolCSA=everyone
weblogic.allow.shrink.weblogic.jdbc.connectionPool.oraclePoolCSA=everyone
weblogic.jdbc.TXDataSource.CSATXDataSource=oraclePoolCSA
--
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
fi...@filip.net
www.filip.net
"Cully Orstad" <cully....@unisys.com> wrote in message
news:3b5706a9$1...@newsgroups.bea.com...
"Filip Hanik" <ma...@filip.net> wrote in message
news:3b571764$1...@newsgroups.bea.com...
Filip
--
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
fi...@filip.net
www.filip.net
"Tony Bailey" <tony.bai...@usa.net> wrote in message
news:3b57...@newsgroups.bea.com...
I should have stated we do not have WLS 6. We are still using WLS 5.1 sp7. I
do not have the example you refered me to.
Cully.
private Blob getBlob(File f, String table)
throws SQLException
{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String SQL;
Blob imgblob = null;
FileInputStream fis = null;
OutputStream bos = null;
try
{
conn = dbutil.getConnection();
SQL = "SELECT image FROM " + table;
pstmt = conn.prepareStatement(SQL);
rs = pstmt.executeQuery();
rs.next();
imgblob = rs.getBlob("image");
logger.log(Debug.DEBUG, "DictTblCtrlr.getBlob(): The blob is: "
+ imgblob);
fis = new FileInputStream(f);
bos = ((OracleBlob)imgblob).getBinaryOutputStream();
byte[] buffer = new byte[65534];
int length = -1;
while ((length = fis.read(buffer)) != -1)
bos.write(buffer, 0, length);
bos.flush();
}
catch (Exception sqle)
{
logger.log(Debug.ERROR, "DictTblCtrlr.getBlob(): " +
sqle.getMessage());
sqle.printStackTrace();
throw new SQLException(sqle.getMessage());
}
finally
{
try { fis.close(); bos.close(); } catch (Exception e) {}
dbutil.release(rs, pstmt, conn);
}
return imgblob;
}
[07-19-2001 03:02:07] DEBUG:DictTblCtrlr.getBlob(): The blob is:
weblogic.jdbc.rmi.SerialBlob@1f1f12
[07-19-2001 03:02:23] ERROR:DictTblCtrlr.getBlob():
java.lang.NullPointerException
java.sql.SQLException: java.lang.NullPointerException
at
weblogic.jdbc.rmi.SerialBlob.getBinaryOutputStream(SerialBlob.java:73)
at
com.uctech.psws.persistence.datacontroller.DictionaryTableController.getBlob
(DictionaryTableController.java:410)
at
com.uctech.psws.persistence.datacontroller.DictionaryTableController.insert(
DictionaryTableController.java:363)
[....]
"Shiva Paranandi" <shi...@yahoo.com> wrote in message
news:3975F0F6...@yahoo.com...
> Could you post the exception?
>
> Shiva.
"Shiva Paranandi" <shi...@yahoo.com> wrote in message
news:397636F3...@yahoo.com...
> Try these two things:
> 1. Change your SQL query to "SELECT image FROM " + table + " for update";
> 2. Also, set conn.setAutoCommit(false);
>
> Shiva.
That was it....instead of doing the Blob work all in the same insert
statement, I grabbed a new sequence and inserted a row with an empty_blob().
After that I did an update on that row setting the correct value of the
Blob.
Thanks for the help!!
"Shiva Paranandi" <shi...@yahoo.com> wrote in message
news:39775BBD...@yahoo.com...
> I tried with SP2 only and it works. The problems might be that you are
getting a
> null blob. Try inserting an emtpy blob first. Check out this program which
works
> for me on WLS 6, SP2.
>
> Shiva.