,
SQLError.SQL_STATE_GENERAL_ERROR);
} finally {
if (blobRs != null) {
try {
blobRs.close();
} catch (SQLException sqlEx) {
; // do nothing
}
blobRs = null;
}
if (pStmt != null) {
try {
pStmt.close();
} catch (SQLException sqlEx) {
; // do nothing
}
pStmt = null;
}
}
}
/**
* Returns the number of bytes in the BLOB value designated by this Blob
* object.
*
* @return the length of this blob
*
* @throws SQLException
* if a database error occurs
*/
public long length() throws SQLException {
java.sql.ResultSet blobRs = null;
java.sql.PreparedStatement pStmt = null;
// FIXME: Needs to use identifiers for column/table names
StringBuffer query = new StringBuffer("SELECT LENGTH(");
query.append(this.blobColumnName);
query.append(") FROM ");
query.append(this.tableName);
query.append(" WHERE ");
query.append((String) this.primaryKeyColumns.get(0));
query.append(" = ?");
for (int i = 1; i < this.numPrimaryKeys; i++) {
query.append(" AND ");
query.
上一篇:
BlobData.java
下一篇:
西班牙语医院科室名称