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

The following examples show how to use java.sql.PreparedStatement#setUnicodeStream() . These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
@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
@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
@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 Project: Zebra   File: UnicodeStreamParamContext.java    License: 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]);
}