File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Probs with Sybase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Probs with Sybase" Watch "Probs with Sybase" New topic

Probs with Sybase

Chinmay Bajikar
Ranch Hand

Joined: Dec 08, 2001
Posts: 159
Hi all,
I am connecting to Sybase db using the JConnect JDBC driver.
But when I fire a query for getting data from a column and the column is blank,then it returns " "(a string of length 1).
If I check for this column on the REsultSet object using the wasNull(),the it still says false.
My appln needs to work on Oracle and MS SQL as well.
The check for blank value in col is,
if(value == null || value.length() == 0)
Now I have to change this to
if(value == null || value.trim().length() == 0)
which I dont want to do,as sometimes leading and trailing spaces might form meaning full data for my client.
Is there any way around this?
Do we have any other Sybase driver which avoids this?
Plzz let me know.

The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
I agree. Here's the link:
subject: Probs with Sybase
It's not a secret anymore!