Re: text datatype support
From: Sue Purkis (suepurkis_at_yahoo.com)
Date: 07/14/04
- Next message: Roman: "MS JDB driver and temp tables scope"
- Previous message: Ty: "text datatype support"
- In reply to: Ty: "text datatype support"
- Messages sorted by: [ date ] [ thread ]
Date: 14 Jul 2004 10:12:51 -0700
Ty,
I am looking into this in more detail, but I have a question for
you. Would you be able to set SendStringParametersAsUnicode to false?
I have included the explanation of that connection property below.
Sue Purkis
DataDirect Technologies
SendStringParametersAsUnicode
SendStringParametersAsUnicode={true | false}. Determines
whether string parameters are sent to the SQL Server database in
Unicode or in the default character encoding of the database.
True means that string parameters are sent to SQL Server in
Unicode. False means that they are sent in the default encoding,
which can improve performance because the server does not need
to convert Unicode characters to the default encoding. You
should, however, use default encoding only if the parameter
string data that you specify is consistent with the default
encoding of the database.
The default is true.
"Ty" <Ty@discussions.microsoft.com> wrote in message news:<4E96E942-4A0D-4E65-BAE6-C3A2BCA45D3A@microsoft.com>...
> I am running SQL 7 on my laptop using an ODBC driver to connect from
java. Getting the datatype text is no problem. However, my ISP uses
SQL 2000 and I have to use a microsoft JDBC driver to access the
database. When running the stored procedure I get incomplete results
due to errors accessing the text field. Is it true you cannot return
text from a stored procedure with this setup? If so, what's the work
around? My work around has been to change all my procedures for the
time being to this "substring(CONTACT_INFO.NOTES,0,3000) as NOTES"
however, truncation occurs.
>
> I also tried changing the code just to get a stream, but it still doesn't work. Any suggestions are welcomed?
>
> public String getBigString( String columnName )
> {
>
> String tempText = "";
>
> try
> {
>
> Reader reader = m_results.getCharacterStream( columnName ); // text data type
>
> if ( m_results.wasNull() )
> {
> tempText = "";
>
> }
> else
> {
>
> BufferedReader bReader = null;
> String inLine;
>
> try
> {
> bReader = new BufferedReader( reader );
>
> while ( ( inLine = bReader.readLine() ) != null )
> {
> tempText += inLine;
>
> }
>
> }
> catch ( IOException e )
> {
> EmailException.sendException( e,
> m_command + " Problem reading column - " +
> columnName + "," + toString() );
>
> }
> finally
> {
>
> try
> {
>
> if ( bReader != null )
> bReader.close();
>
> }
> catch ( IOException e )
> {
> e.printStackTrace();
>
> }
>
> }
>
> }
>
> }
> catch ( SQLException e )
> {
> EmailException.sendException( e,
> m_command + " Problem with column - " + columnName +
> "," + toString() );
>
> return null;
>
> }
>
> return tempText;
>
> }
- Next message: Roman: "MS JDB driver and temp tables scope"
- Previous message: Ty: "text datatype support"
- In reply to: Ty: "text datatype support"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|