Board index » jbuilder » Sybase query issue

Sybase query issue


2004-01-08 12:35:46 AM
jbuilder1
Any help would be appreciated with this programming problem:
We're running a Sybase database where I work. I'm trying to run a query
that returns a column ("TextData") from a table whose Sybase datatype is
varchar(1900).
Following is a code snippet from what I'm running:
Connection c; // valid connection to the database
PreparedStatement ps = c.prepareStatement(<problematic_query>);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
String td = rs.getString("TextData");
System.out.println(td);
System.out.println("length: " + td.length());
}
ps.close();
rs.close();
The problem I'm having is that the value retrieved from the database by the
java code is truncated to a length of 255 characters. So the challenge is
to discover how to get TextData out of the database into a String object
without truncating it.
Any ideas would be appreciated.
 
 

Re:Sybase query issue

Frank Pedroza wrote:
Quote
Any help would be appreciated with this programming problem:

We're running a Sybase database where I work. I'm trying to run a query
that returns a column ("TextData") from a table whose Sybase datatype is
varchar(1900).

Following is a code snippet from what I'm running:

Connection c; // valid connection to the database

PreparedStatement ps = c.prepareStatement(<problematic_query>);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
String td = rs.getString("TextData");
System.out.println(td);
System.out.println("length: " + td.length());
}

ps.close();
rs.close();

The problem I'm having is that the value retrieved from the database by the
java code is truncated to a length of 255 characters. So the challenge is
to discover how to get TextData out of the database into a String object
without truncating it.

Any ideas would be appreciated.


This thread might shed some light on the scene.
(Watch for wrapping)
www.google.ca/groups&lr=&ie=UTF-8&oe=UTF-8&selm=eR2Ilx%244CHA.2312%40TK2MSFTNGP10.phx.gbl&rnum=7
--
Regards,
Lori Olson (TeamB)
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html