1

Topic: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

There is an Oracle 9i, in it the table with a field, say, in 3000 length. On the server the coding cp1251, that is in the field is located 3000 Russian letters. However if to try to interpose value into this field through standard PreparedStatement.setString it is direct from the driver the error takes off. It at first converts a line in UTF-8, the length 6000, and the driver more than 4000 turns out does not pass (and that on the server it will again be pressed in 3000 it does not excite). Basically in the documentation it is described, but as it to avoid - is not described. Meanwhile found a simple method - stupidly to interpose a line into request in the best traditions PHP ("insert into t values ('" + str + "')"). Whether It is possible to invent still something?

2

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

Hello, vsb, you wrote: vsb> There is an Oracle 9i, in it the table with a field, say, in 3000 length. On the server the coding cp1251, that is in the field is located 3000 Russian letters. However if to try to interpose value into this field through standard PreparedStatement.setString it is direct from the driver the error takes off. It at first converts a line in UTF-8, the length 6000, and the driver more than 4000 turns out does not pass (and that on the server it will again be pressed in 3000 it does not excite). Basically in the documentation it is described, but as it to avoid - is not described. Meanwhile found a simple method - stupidly to interpose a line into request in the best traditions PHP ("insert into t values ('" + str + "')"). Whether It is possible to invent still something? And if to use setCharacterStream (int parameterIndex, Reader reader) and to transfer StringReader (String) from your line? Big (on the size) generally it is better so to transfer values.

3

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

Hello, UDI, you wrote: UDI> And if to use setCharacterStream (int parameterIndex, Reader reader) and to transfer StringReader (String) from your line? Big (on the size) generally it is better so to transfer values. Exception in thread "main" java.lang. AbstractMethodError: Method oracle/jdbc/driver/OraclePreparedStatement.setCharacterStream (ILjava/io/Reader V is abstract It seems that then such method in jdbc yet was not.

4

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

Hello, vsb, you wrote: vsb> Exception in thread "main" java.lang. AbstractMethodError: Method oracle/jdbc/driver/OraclePreparedStatement.setCharacterStream (ILjava/io/Reader V is abstract vsb> It seems that then such method in jdbc yet was not. , and what version jdbc the driver and what type of a column in the table?

5

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

Hello, UDI, you wrote: vsb>> Exception in thread "main" java.lang. AbstractMethodError: Method oracle/jdbc/driver/OraclePreparedStatement.setCharacterStream (ILjava/io/Reader V is abstract vsb>> It seems that then such method in jdbc yet was not. UDI> Hm, and what version jdbc the driver the Driver is pulled out from a DB 9.2.0.8, most current release on idea. UDI> and what type of a column in the table? varchar2 (4000)

6

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

7

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

Hello, vsb, you wrote: vsb> Exception in thread "main" java.lang. AbstractMethodError: Method oracle/jdbc/driver/OraclePreparedStatement.setCharacterStream (ILjava/io/Reader V is abstract vsb> It seems that then such method in jdbc yet was not. Looked from version 9.0 there is an implementation of a method with instructions of length, as amounts of characters, void setCharacterStream (int parameterIndex, Reader reader, int length), where length - the number of characters in the stream.

8

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

Hello, UDI, you wrote: UDI> Looked from version 9.0 there is an implementation of a method with instructions of length, as amounts of characters, void setCharacterStream (int parameterIndex, Reader reader, int length), where UDI> UDI> length - the number of characters in the stream. There the last parameter of type int. Similar from the version of the driver 10.2, it [driver] itself passes to usage setXXXStream for the big data and check for the size does not happen on the client, but happens in basis. Peeped here.

9

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

10

Re: The Oracle 9i, PreparedStatement.setString is more than 2000 characters

Hello, UDI, you wrote: UDI>> Looked from version 9.0 there is an implementation of a method with instructions of length, as amounts of characters, void setCharacterStream (int parameterIndex, Reader reader, int length), where UDI>> UDI>> length - the number of characters in the stream. UDI> There the last parameter of type int. In a pancake, like all overloads checked up, but it appears checked with long th, and there also int-ovaja is. And it works! Many thanks, even standard JDBC were possible to manage, I with oracle.sql. CHAR it tried to be picked. UDI> it is similar from the version of the driver 10.2, it itself passes [driver] to usage setXXXStream for the big data and check for the size does not happen on the client, but happens in basis. Peeped here. I by the way looked, but not that overload checked, therefore thought that the author not so did something. Well to check up length of a line it at all a problem.