use of org.h2.jdbc.JdbcClob in project h2database by h2database.
the class JdbcResultSet method getNClob.
/**
* Returns the value of the specified column as a Clob.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public NClob getNClob(int columnIndex) throws SQLException {
try {
int id = getNextId(TraceObject.CLOB);
if (isDebugEnabled()) {
debugCodeAssign("NClob", TraceObject.CLOB, id, "getNClob(" + columnIndex + ")");
}
Value v = get(columnIndex);
return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id);
} catch (Exception e) {
throw logAndConvert(e);
}
}
use of org.h2.jdbc.JdbcClob in project h2database by h2database.
the class JdbcConnection method createClob.
/**
* Create a new empty Clob object.
*
* @return the object
*/
@Override
public Clob createClob() throws SQLException {
try {
int id = getNextId(TraceObject.CLOB);
debugCodeAssign("Clob", TraceObject.CLOB, id, "createClob()");
checkClosedForWrite();
try {
Value v = session.getDataHandler().getLobStorage().createClob(new InputStreamReader(new ByteArrayInputStream(Utils.EMPTY_BYTES)), 0);
session.addTemporaryLob(v);
return new JdbcClob(this, v, id);
} finally {
afterWriting();
}
} catch (Exception e) {
throw logAndConvert(e);
}
}
use of org.h2.jdbc.JdbcClob in project h2database by h2database.
the class JdbcConnection method createNClob.
/**
* Create a new empty NClob object.
*
* @return the object
*/
@Override
public NClob createNClob() throws SQLException {
try {
int id = getNextId(TraceObject.CLOB);
debugCodeAssign("NClob", TraceObject.CLOB, id, "createNClob()");
checkClosedForWrite();
try {
Value v = session.getDataHandler().getLobStorage().createClob(new InputStreamReader(new ByteArrayInputStream(Utils.EMPTY_BYTES)), 0);
session.addTemporaryLob(v);
return new JdbcClob(this, v, id);
} finally {
afterWriting();
}
} catch (Exception e) {
throw logAndConvert(e);
}
}
use of org.h2.jdbc.JdbcClob in project h2database by h2database.
the class JdbcResultSet method getNClob.
/**
* Returns the value of the specified column as a Clob.
*
* @param columnLabel the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public NClob getNClob(String columnLabel) throws SQLException {
try {
int id = getNextId(TraceObject.CLOB);
if (isDebugEnabled()) {
debugCodeAssign("NClob", TraceObject.CLOB, id, "getNClob(" + columnLabel + ")");
}
Value v = get(columnLabel);
return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id);
} catch (Exception e) {
throw logAndConvert(e);
}
}
use of org.h2.jdbc.JdbcClob in project h2database by h2database.
the class JdbcResultSet method getClob.
/**
* Returns the value of the specified column as a Clob.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public Clob getClob(int columnIndex) throws SQLException {
try {
int id = getNextId(TraceObject.CLOB);
if (isDebugEnabled()) {
debugCodeAssign("Clob", TraceObject.CLOB, id, "getClob(" + columnIndex + ")");
}
Value v = get(columnIndex);
return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id);
} catch (Exception e) {
throw logAndConvert(e);
}
}
Aggregations