Java Code Examples for java.sql.PreparedStatement#setUnicodeStream()

The following examples show how to use java.sql.PreparedStatement#setUnicodeStream() . 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: PreparedStatementAdapterTest.java    From sharding-jdbc-1.5.1 with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
@Test
public void assertSetUnicodeStream() throws SQLException, IOException {
    for (PreparedStatement each : preparedStatements) {
        try (InputStream inputStream = new ByteArrayInputStream(new byte[]{})) {
            each.setUnicodeStream(1, inputStream, 100);
            assertParameter(each, 1, inputStream);
        }
    }
}
 
Example 2
Source File: PreparedStatementAdapterTest.java    From shardingsphere with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
@Test
public void assertSetUnicodeStream() throws SQLException, IOException {
    for (PreparedStatement each : preparedStatements) {
        try (InputStream inputStream = new ByteArrayInputStream(new byte[]{})) {
            each.setUnicodeStream(1, inputStream, 100);
            assertParameter(each, 1, inputStream);
        }
    }
}
 
Example 3
Source File: PreparedStatementWrapper.java    From Oceanus with Apache License 2.0 5 votes vote down vote up
@Override
public void setUnicodeStream(final int parameterIndex, final InputStream x,
		final int length) throws SQLException {
	ParameterCallback callback = new ParameterCallbackAction(
			parameterIndex, x) {

		@SuppressWarnings("deprecation")
		@Override
		public void call(PreparedStatement preparedStatement)
				throws SQLException {
			preparedStatement.setUnicodeStream(parameterIndex(), (InputStream)getParameter(), length);
		}
	};
	addParameterCallback(callback);
}
 
Example 4
Source File: UnicodeStreamParamContext.java    From Zebra with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public void setParam(PreparedStatement stmt) throws SQLException {
	stmt.setUnicodeStream(index, (InputStream) values[0], (Integer) values[1]);
}