Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JConnect giving different results than ISQL

14 views
Skip to first unread message

ryjan

unread,
Jan 18, 2010, 3:33:33 PM1/18/10
to
I have a simple java UI that connects to a Sybase ASA 10 DB
using JConnect 6.05(Build 25828).

Running the same query using the tool generates completely
different data than running in ISQL.

The only issue seen in ISQL is the following error:

NULL value eliminated in aggregate function SQLCODE=109,
ODBC 3 State = "01003".

My java app is not throwing any errors in the execution and
the getWarnings() method returns null.

Is there something happening in the JConnect libraries that
handles this differently than ISQL? Any ideas on how to get
the results to match?

joe.we...@gmail.com

unread,
Jan 18, 2010, 8:36:03 PM1/18/10
to

I'll bet you may be setting PreparedStatement parameter
values for search criteria. I ask if the column is a fixed-char-length
datum, and the values you pass in are not padded out to the
full length?

Try sending the SQL from JDBC totally hard-wired.

(Guesses... Let me know more details if I'm off...)
Joe

ryjan

unread,
Jan 18, 2010, 10:06:39 PM1/18/10
to
Thanks for the response.

The most complicated thing about it is the actual query. I
developed it and it works correctly using dbisql, I was
expecting to be able to plug it into my java app without
issue, but here i am.with my only clue the error message
dbisql generates, but ignores.

Here's the basic code:

db = openDatabase("com.sybase.jdbc3.jdbc.SybDriver",
"jdbc:sybase:Tds:"+server+":"+port+"?ServiceName="+=svcName
, usr, pwd);
stmt = db.createStatement();
rs = stmt.executeQuery(db.nativeSQL(generateQuery()));

Where

public string generateQuery(){
StringBuffer sql = new StringBuffer();
sql.append("Select col1, col2, ...");
...
sql.append("from tablename");
return sql.toString();
}

Its a select statement that returns 22 columns and one row.
all values are doubles.

Karim Khamis [Sybase iAnywhere]

unread,
Jan 19, 2010, 9:13:15 AM1/19/10
to
Please note that dbisql uses the iAnywhere JDBC driver instead of
jConnect. The SA server will be have differently for applications
connecting using jConnect versus applications connecting using the
iAnywhere JDBC driver. Have you considered switching to the iAnywhere
JDBC driver for SA connections?

Karim

ryjan

unread,
Jan 19, 2010, 10:42:51 AM1/19/10
to
Thanks karim!

That looks to have done it. Doesn't make a lot of sense to
me, but whatever. it works.

0 new messages