java.sql.NClob Java Examples
The following examples show how to use
java.sql.NClob.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DelegatingConnection.java From Tomcat8-Source-Read with MIT License | 5 votes |
@Override public NClob createNClob() throws SQLException { checkOpen(); try { return connection.createNClob(); } catch (final SQLException e) { handleException(e); return null; } }
Example #2
Source File: JDBC4CallableStatementWrapper.java From Komondor with GNU General Public License v3.0 | 5 votes |
/** * @see java.sql.CallableStatement#getNClob(java.lang.String) */ public NClob getNClob(String parameterName) throws SQLException { try { if (this.wrappedStmt != null) { return ((CallableStatement) this.wrappedStmt).getNClob(parameterName); } else { throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor); } } catch (SQLException sqlEx) { checkAndFireConnectionError(sqlEx); } return null; }
Example #3
Source File: StubFilteredRowSetImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Override public NClob getNClob(int columnIndex) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
Example #4
Source File: GroupResultSet.java From Zebra with Apache License 2.0 | 4 votes |
@Override public void updateNClob(String columnLabel, NClob nClob) throws SQLException { innerResultSet.updateNClob(columnLabel, nClob); }
Example #5
Source File: LogicalCallableStatement40.java From gemfirexd-oss with Apache License 2.0 | 4 votes |
public NClob getNClob(int arg0) throws SQLException { return getPhysCs().getNClob(arg0); }
Example #6
Source File: StubCachedRowSetImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Override public void setNClob(String parameterName, NClob value) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
Example #7
Source File: AbstractCloudSpannerResultSet.java From spanner-jdbc with MIT License | 4 votes |
@Override public NClob getNClob(String columnLabel) throws SQLException { throw new SQLFeatureNotSupportedException(); }
Example #8
Source File: JdbcResultSet.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override public NClob getNClob(int colIdx) throws SQLException { ensureNotClosed(); throw new SQLFeatureNotSupportedException("SQL-specific types are not supported."); }
Example #9
Source File: MockConnection.java From doma with Apache License 2.0 | 4 votes |
@Override public NClob createNClob() throws SQLException { AssertionUtil.notYetImplemented(); return null; }
Example #10
Source File: JdbcThinResultSet.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override public void updateNClob(String colLb, NClob nClob) throws SQLException { ensureNotClosed(); throw new SQLFeatureNotSupportedException("Updates are not supported."); }
Example #11
Source File: NClobTypeDescriptor.java From lams with GNU General Public License v2.0 | 4 votes |
public NClob assemble(Serializable cached) { throw new UnsupportedOperationException( "Clobs are not cacheable" ); }
Example #12
Source File: StubWebRowSetImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@Override public void setNClob(String parameterName, NClob value) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
Example #13
Source File: StatementsTest.java From FoxTelem with GNU General Public License v3.0 | 4 votes |
/** * Tests for ResultSet.updateNClob() * * @throws Exception */ public void testUpdateNClob() throws Exception { createTable("testUpdateNChlob", "(c1 CHAR(10) PRIMARY KEY, c2 NATIONAL CHARACTER(10)) default character set sjis"); Properties props1 = new Properties(); props1.setProperty(PropertyKey.useServerPrepStmts.getKeyName(), "true"); // use server-side prepared statement props1.setProperty(PropertyKey.characterEncoding.getKeyName(), "UTF-8"); // ensure charset isn't utf8 here Connection conn1 = getConnectionWithProps(props1); PreparedStatement pstmt1 = conn1.prepareStatement("INSERT INTO testUpdateNChlob (c1, c2) VALUES (?, ?)"); pstmt1.setString(1, "1"); NClob nClob1 = conn1.createNClob(); nClob1.setString(1, "aaa"); pstmt1.setNClob(2, nClob1); pstmt1.execute(); Statement stmt1 = conn1.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); ResultSet rs1 = stmt1.executeQuery("SELECT c1, c2 FROM testUpdateNChlob"); rs1.next(); NClob nClob2 = conn1.createNClob(); nClob2.setString(1, "bbb"); rs1.updateNClob("c2", nClob2); rs1.updateRow(); rs1.moveToInsertRow(); rs1.updateString("c1", "2"); NClob nClob3 = conn1.createNClob(); nClob3.setString(1, "ccc"); rs1.updateNClob("c2", nClob3); rs1.insertRow(); ResultSet rs2 = stmt1.executeQuery("SELECT c1, c2 FROM testUpdateNChlob"); rs2.next(); assertEquals("1", rs2.getString("c1")); assertEquals("bbb", rs2.getNString("c2")); rs2.next(); assertEquals("2", rs2.getString("c1")); assertEquals("ccc", rs2.getNString("c2")); pstmt1.close(); stmt1.close(); conn1.close(); createTable("testUpdateNChlob", "(c1 CHAR(10) PRIMARY KEY, c2 CHAR(10)) default character set sjis"); // sjis field Properties props2 = new Properties(); props2.setProperty(PropertyKey.useServerPrepStmts.getKeyName(), "true"); // use server-side prepared statement props2.setProperty(PropertyKey.characterEncoding.getKeyName(), "SJIS"); // ensure charset isn't utf8 here Connection conn2 = getConnectionWithProps(props2); PreparedStatement pstmt2 = conn2.prepareStatement("INSERT INTO testUpdateNChlob (c1, c2) VALUES (?, ?)"); pstmt2.setString(1, "1"); pstmt2.setString(2, "aaa"); pstmt2.execute(); Statement stmt2 = conn2.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); ResultSet rs3 = stmt2.executeQuery("SELECT c1, c2 FROM testUpdateNChlob"); rs3.next(); NClob nClob4 = conn2.createNClob(); nClob4.setString(1, "bbb"); try { rs3.updateNClob("c2", nClob4); // field's charset isn't utf8 fail(); } catch (SQLException ex) { assertEquals("Can not call updateNClob() when field's character set isn't UTF-8", ex.getMessage()); } rs3.close(); pstmt2.close(); stmt2.close(); conn2.close(); }
Example #14
Source File: SumkConnection.java From sumk with Apache License 2.0 | 4 votes |
@Override public NClob createNClob() throws SQLException { return inner.createNClob(); }
Example #15
Source File: DelegatePreparedStatement.java From phoenix with Apache License 2.0 | 4 votes |
@Override public void setNClob(int parameterIndex, NClob value) throws SQLException { ps.setNClob(parameterIndex, value); }
Example #16
Source File: PhoenixResultSet.java From phoenix with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public NClob getNClob(int columnIndex) throws SQLException { throw new SQLFeatureNotSupportedException(); }
Example #17
Source File: StubCachedRowSetImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@Override public NClob getNClob(int columnIndex) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
Example #18
Source File: StubFilteredRowSetImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Override public NClob getNClob(String columnLabel) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
Example #19
Source File: StubJoinRowSetImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Override public void updateNClob(int columnIndex, NClob nClob) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
Example #20
Source File: LoggingResultSet.java From activemq-artemis with Apache License 2.0 | 4 votes |
@Override public void updateNClob(String columnLabel, NClob x) throws SQLException { logger.logf(level, "%s.updateNClob(%s, %s)", resultSetID, columnLabel, x); resultSet.updateNClob(columnLabel, x); }
Example #21
Source File: MockResultSet.java From glowroot with Apache License 2.0 | 4 votes |
@Override public NClob getNClob(String columnLabel) throws SQLException { return null; }
Example #22
Source File: StubSyncResolver.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@Override public void updateNClob(int columnIndex, NClob nClob) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
Example #23
Source File: PhoenixConnection.java From phoenix with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public NClob createNClob() throws SQLException { throw new SQLFeatureNotSupportedException(); }
Example #24
Source File: StubJdbcRowSetImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@Override public void setNClob(int parameterIndex, NClob value) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
Example #25
Source File: RowSetsResultSet.java From Oceanus with Apache License 2.0 | 4 votes |
@Override public void updateNClob(int columnIndex, NClob nClob) throws SQLException { throw new UnsupportedOperationException(); }
Example #26
Source File: ResultSetAdaptor.java From hibernate-reactive with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void updateNClob(String columnLabel, NClob nClob) { throw new UnsupportedOperationException(); }
Example #27
Source File: JdbcTemplate.java From sockslib with Apache License 2.0 | 4 votes |
private void setParameter(PreparedStatement preparedStatement, Object[] args) throws SQLException { if (args == null || args.length == 0) { return; } for (int i = 0; i < args.length; i++) { Object arg = args[i]; if (TypeUtil.isInt(arg)) { preparedStatement.setInt(i + 1, (Integer) arg); } else if (TypeUtil.isString(arg)) { preparedStatement.setString(i + 1, (String) arg); } else if (TypeUtil.isLong(arg)) { preparedStatement.setLong(i + 1, (Long) arg); } else if (TypeUtil.isDouble(arg)) { preparedStatement.setDouble(i + 1, (Double) arg); } else if (TypeUtil.isFloat(arg)) { preparedStatement.setFloat(i + 1, (Float) arg); } else if (TypeUtil.isBoolean(arg)) { preparedStatement.setBoolean(i + 1, (Boolean) arg); } else if (TypeUtil.isByte(arg)) { preparedStatement.setByte(i + 1, (Byte) arg); } else if (TypeUtil.isDate(arg)) { preparedStatement.setDate(i + 1, (Date) arg); } else if (TypeUtil.isShort(arg)) { preparedStatement.setShort(i + 1, (Short) arg); } else if (TypeUtil.isArray(arg)) { preparedStatement.setArray(i + 1, (Array) arg); } else if (TypeUtil.isInputStream(arg)) { preparedStatement.setAsciiStream(i + 1, (InputStream) arg); } else if (TypeUtil.isBigDecimal(arg)) { preparedStatement.setBigDecimal(i + 1, (BigDecimal) arg); } else if (TypeUtil.isBlob(arg)) { preparedStatement.setBlob(i + 1, (Blob) arg); } else if (TypeUtil.isBytes(arg)) { preparedStatement.setBytes(i + 1, (byte[]) arg); } else if (TypeUtil.isClob(arg)) { preparedStatement.setClob(i + 1, (Clob) arg); } else if (TypeUtil.isNClob(arg)) { preparedStatement.setNClob(i + 1, (NClob) arg); } else { throw new IllegalArgumentException( "Type:" + arg.getClass().getName() + " is not supported"); } } }
Example #28
Source File: UpdatableVTITemplate.java From gemfirexd-oss with Apache License 2.0 | 4 votes |
public void setNClob(int index, NClob value) throws SQLException{ throw Util.notImplemented(); }
Example #29
Source File: ResultSet.java From nextreports-server with Apache License 2.0 | 4 votes |
@Override public NClob getNClob(int columnIndex) throws SQLException { throw new NotImplementedException(); }
Example #30
Source File: BrokeredCallableStatement40.java From gemfirexd-oss with Apache License 2.0 | 4 votes |
public NClob getNClob(String parameterName) throws SQLException{ return getCallableStatement().getNClob(parameterName); }