Not sure why you are getting blob not found error .
IFX_CODESETLOB seems to work only with the methods from
java.sql.PreparedStatement interface
i.e. PreparedStatement::setAsciiStream()
and PreparedStatement::getAsciiStream()
Make sure that you have set CLIENT_LOCALE and DB_LOCALE property to correct value.
If you are using methods from jaca.sql.Clob interface ,
I think you need to convert using JDK methods as shown
in Informix JDBC manual
http://publibfi.boulder.ibm.com/epubs/pdf/ct1utna.pdf
page 6-22.
Here is a code sample which inserts and fetches from a
clob column
Your connection url will look something like this
String url =".........;CLIENT_LOCALE=en_US.CP1252;IFX_CODESET LOB=1;DB_LOCALE=en_US.8859-1;......";
public static void insertStuff(Connection conn) throws SQLException , IOException
{
try
{
Statement stmt = conn.createStatement();
stmt.executeUpdate("drop table tab1");
stmt.close();
}
catch (SQLException e)
{
System.out.println(e);
}
try
{
Statement stmt = conn.createStatement();
stmt.executeUpdate("create table tab1 (col1 clob)");
}
catch (SQLException e)
{
System.out.println(e);
}
PreparedStatement pstmt = conn.prepareStatement("insert into tab1 (col1) values (?)");
File f = new File("c:\\sample.txt");
long size = f.length();
InputStream is = new FileInputStream(f);
// this will codeset convert text from CLIENT_LOCALE codeset
// to DB_LOCALE codeset
pstmt.setAsciiStream(1,is,(int)size);
pstmt.execute();
pstmt.close();
}
public static void getStuff(Connection conn) throws SQLException , IOException
{
PreparedStatement pstmt = conn.prepareStatement("select (col1) from tab1");
ResultSet rs = pstmt.executeQuery();
while(rs.next())
{
// this will codeset convert text from DB_LOCALE codeset
// to CLIENT_LOCALE codeset
InputStream is = rs.getAsciiStream(1);
byte[] recv = new byte[is.available()];
is.read(recv);
is.close();
}
}