File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Probs with Sybase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Probs with Sybase" Watch "Probs with Sybase" New topic
Author

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.
thanks,
Chinmay


The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Probs with Sybase