long fileLength = file.length();
InputStream is = null;
try {
ClobData clob = session.createClob(fileLength);
is = new FileInputStream(file);
Reader reader = new InputStreamReader(is, encoding);
is = new ReaderInputStream(reader);
database.lobManager.setCharsForNewClob(clob.getId(), is,
fileLength, true);
return clob;
} catch (IOException e) {
throw Error.error(ErrorCode.FILE_IO_ERROR, e.toString());