[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Truncated varchar values in jisql  XML
Forum Index » Jisql
Author Message
leono

Newbie

Joined: 11/07/2005 13:23:53
Messages: 2
Offline

Hi! I'm using jisql on the command line to connect to a MS SQL Server, and all of my varchar values are truncated to 24 characters. I'm using Microsoft's JDBC driver. Any ideas why this truncation might be happening?
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

Would it be possible to post your DDL - the descriptions of your tables? I've used this on MS/SQL and haven't seen this.

Also, can you run jisql with the -driverinfo command line argument? I'd like to be able to test with the same versions that you're using.

Thanks for reporting this!

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
leono

Newbie

Joined: 11/07/2005 13:23:53
Messages: 2
Offline

DDL:

create table tblLenTest ( mycol varchar (50))
GO
insert into tblLenTest(mycol) values('This is a string which is longer than 24 chars')
GO

Then, executing:
java -classpath /Users/leon/Desktop/Download/jisql/lib/jisql.jar:/Users/leon/cvs/_shared/_Java/mssql/mssqlserver.jar:/Users/leon/cvs/_shared/_Java/mssql/msbase.jar:/Users/leon/cvs/_shared/_Java/mssql/msutil.jar com.xigole.util.sql.Jisql -driver mssql -user XXX -password XXX -c \; -cstring jdbc:microsoft:sqlserver://XXX:1433;databaseName=master


and entering:
1 > select * from tblLenTest;

results in:
mycol |
-------------------------|
This is a string which i |


Driver Info:

driver.getMajorVersion() is 2
driver.getMinorVersion() is 2
driver is JDBC compliant
driver property named "netAddress"
description: "Workstation's network interface card address"
required parameter?: "false"
current value: "000000000000"

driver property named "portNumber"
description: "Port number"
required parameter?: "false"
current value: "1433"

driver property named "hostProcess"
description: "Workstation process ID number"
required parameter?: "false"
current value: "0"

driver property named "user"
description: "Login ID"
required parameter?: "true"
current value: ""

driver property named "sendStringParametersAsUnicode"
choices:
choice 0: "false"
choice 1: "true"
description: "Send UCS2 String Parameters As Unicode"
required parameter?: "false"
current value: "true"

driver property named "databaseName"
description: "Database name"
required parameter?: "false"
current value: ""

driver property named "programName"
description: "Name of the application program"
required parameter?: "false"
current value: ""

driver property named "serverName"
description: "Server name"
required parameter?: "true"
current value: ""

driver property named "selectMethod"
choices:
choice 0: "cursor"
choice 1: "direct"
description: "Select Method"
required parameter?: "false"
current value: "direct"

driver property named "WSID"
description: "Workstation's ID"
required parameter?: "false"
current value: ""

driver property named "password"
description: "Login Password"
required parameter?: "true"
current value: ""

metaData.getDatabaseProductName(): "Microsoft SQL Server"
metaData.getDatabaseProductVersion(): "Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 1)
"
metaData.getDriverName(): "SQLServer"
metaData.getDriverVersion(): "2.2.0029"

This message was edited 1 time. Last update was at 12/15/2005 08:38:07

stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

That is just what I needed - let me take a look. Thanks for the information.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
akerr

Newbie

Joined: 12/15/2005 14:03:56
Messages: 1
Offline

For what it's worth, we have the same problem using the jTDS JDBC driver for SQL Server.
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

A new version of Jisql is now available that fixes this bug. More information is available at the Jisql home page but basically I've flipped the default behavior from always truncating columns to optionally truncating columns. Please let me know if you have any problems with this version.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
Anonymous



Perfect, this fixes the problem for us nicely. Thanks for the patch.
 
Forum Index » Jisql
Go to:   
Powered by JForum 2.1.8 © JForum Team
This site built by Scott Dunbar of Xigole Systems. © 2005-2010 - Scott Dunbar
Java and the Java Get Powered logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
hotjoe.com and xigole.com have no affiliation with Sun Microsystems, Inc.