Java Code Examples for java.sql.Connection.createClob()

The following are Jave code examples for showing how to use createClob() of the java.sql.Connection class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: the-vigilantes   File: ConnectionRegressionTest.java   View Source Code Vote up 6 votes
/**
 * Tests fix for Bug#56122 - JDBC4 functionality failure when using replication connections.
 */
public void testBug56122() throws Exception {
    for (final Connection testConn : new Connection[] { this.conn, getFailoverConnection(), getLoadBalancedConnection(),
            getMasterSlaveReplicationConnection() }) {
        testConn.createClob();
        testConn.createBlob();
        testConn.createNClob();
        testConn.createSQLXML();
        testConn.isValid(12345);
        testConn.setClientInfo(new Properties());
        testConn.setClientInfo("NAME", "VALUE");
        testConn.getClientInfo();
        testConn.getClientInfo("CLIENT");
        assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
            public Void call() throws Exception {
                testConn.createArrayOf("A_TYPE", null);
                return null;
            }
        });
        assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
            public Void call() throws Exception {
                testConn.createStruct("A_TYPE", null);
                return null;
            }
        });
    }
}
 
Example 2
Project: ProyectoPacientes   File: ConnectionRegressionTest.java   View Source Code Vote up 6 votes
/**
 * Tests fix for Bug#56122 - JDBC4 functionality failure when using replication connections.
 */
public void testBug56122() throws Exception {
    for (final Connection testConn : new Connection[] { this.conn, getFailoverConnection(), getLoadBalancedConnection(),
            getMasterSlaveReplicationConnection() }) {
        testConn.createClob();
        testConn.createBlob();
        testConn.createNClob();
        testConn.createSQLXML();
        testConn.isValid(12345);
        testConn.setClientInfo(new Properties());
        testConn.setClientInfo("NAME", "VALUE");
        testConn.getClientInfo();
        testConn.getClientInfo("CLIENT");
        assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
            public Void call() throws Exception {
                testConn.createArrayOf("A_TYPE", null);
                return null;
            }
        });
        assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
            public Void call() throws Exception {
                testConn.createStruct("A_TYPE", null);
                return null;
            }
        });
    }
}
 
Example 3
Project: mongodb-rdbms-sync   File: SqlLiteralFactory.java   View Source Code Vote up 6 votes
public static Literal getLobLiteral(Object inputValue, String dataType, Connection connection) throws SQLException{
	Literal literal = null;
	if(connection==null){
		literal = new NullLiteral();
	}else{
		if(SqlColumnType.BLOB.equalsIgnoreCase(dataType)){
			literal= new BlobLiteral();
			Blob blob = connection.createBlob();
			Binary objArray = (Binary) inputValue;
			blob.setBytes(1, objArray.getData());
			literal.setLiteralValue(blob);
		}else if(SqlColumnType.CLOB.equalsIgnoreCase(dataType)){
			literal = new ClobLiteral();
			Clob clob = connection.createClob();
			clob.setString(1, String.valueOf(inputValue));
			literal.setLiteralValue(clob);
		}
	}
	return literal;
}
 
Example 4
Project: OpenVertretung   File: ConnectionRegressionTest.java   View Source Code Vote up 5 votes
/**
 * Tests fix for Bug#56122 - JDBC4 functionality failure when using replication connections.
 */
public void testBug56122() throws Exception {
    for (final Connection testConn : new Connection[] { this.conn, getFailoverConnection(), getLoadBalancedConnection(),
            getMasterSlaveReplicationConnection() }) {
        testConn.createClob();
        testConn.createBlob();
        testConn.createNClob();
        testConn.createSQLXML();
        testConn.isValid(12345);
        testConn.setClientInfo(new Properties());
        testConn.setClientInfo("NAME", "VALUE");
        testConn.getClientInfo();
        testConn.getClientInfo("CLIENT");
        assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
            public Void call() throws Exception {
                testConn.createArrayOf("A_TYPE", null);
                return null;
            }
        });
        assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
            public Void call() throws Exception {
                testConn.createStruct("A_TYPE", null);
                return null;
            }
        });
    }
}
 
Example 5
Project: BibliotecaPS   File: ConnectionRegressionTest.java   View Source Code Vote up 5 votes
/**
 * Tests fix for Bug#56122 - JDBC4 functionality failure when using replication connections.
 */
public void testBug56122() throws Exception {
    for (final Connection testConn : new Connection[] { this.conn, getFailoverConnection(), getLoadBalancedConnection(),
            getMasterSlaveReplicationConnection() }) {
        testConn.createClob();
        testConn.createBlob();
        testConn.createNClob();
        testConn.createSQLXML();
        testConn.isValid(12345);
        testConn.setClientInfo(new Properties());
        testConn.setClientInfo("NAME", "VALUE");
        testConn.getClientInfo();
        testConn.getClientInfo("CLIENT");
        assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
            public Void call() throws Exception {
                testConn.createArrayOf("A_TYPE", null);
                return null;
            }
        });
        assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
            public Void call() throws Exception {
                testConn.createStruct("A_TYPE", null);
                return null;
            }
        });
    }
}
 
Example 6
Project: lams   File: ContextualLobCreator.java   View Source Code Vote up 4 votes
@Override
public Clob executeOnConnection(Connection connection) throws SQLException {
	return connection.createClob();
}
 
Example 7
Project: uroborosql   File: JdbcParameterFactory.java   View Source Code Vote up 3 votes
/**
 * {@link java.sql.Connection#createClob()}のラッパー
 *
 * @param conn コネクション
 * @return Clobインタフェースを実装しているオブジェクト
 *
 * @see java.sql.Connection#createClob()
 */
public static Clob createClob(final Connection conn) {
	try {
		return conn.createClob();
	} catch (SQLException e) {
		throw new UroborosqlRuntimeException(e);
	}
}