Skip to Content.
Sympa Menu

freetds - [freetds] FreeTds JDBC driver

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Eyal Yekutiel" <eyal AT e4x.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] FreeTds JDBC driver
  • Date: Thu, 19 Jun 2003 16:16:52 +0300

Hi all,

I send this email to you , cause I can't find reference anywhere to my
problem.

I use FreeTds JDBC Driver to connect MS SQL Server 7.0 from my Java
Application .

When I try to select Numeric column from a table, I get an exception when
trying to call ResultSet.next() .
Thats before I try to get any value.

Please advise what am I doing wrong
Thanks in advance
Eyal

The exception I get is :
com.internetcds.jdbc.tds.TdsConfused: Protocol confusion- Was expecting a
length of 17, got 9
at com.internetcds.jdbc.tds.Tds.getDecimalValue(Tds.java:909)
at com.internetcds.jdbc.tds.Tds.getRow(Tds.java:1139)
at com.internetcds.jdbc.tds.Tds.processSubPacket(Tds.java:717)
at
com.internetcds.jdbc.tds.ResultSet_base.next(ResultSet_base.java:735)
at e4x.test.DBTest.queryDB(DBTest.java:67)
at e4x.test.DBTest.main(DBTest.java:147)

My code:

Statement stmnt = null;
ResultSet rs = null;
try
{
stmnt = conn.createStatement();
rs = stmnt.executeQuery("Select Value from Quotes");

if (rs.next())
{
result = rs.getString(1);
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
finally
{
try
{
if (rs != null)
rs.close();
}
catch (Exception ex)
{
ex.printStackTrace();
}

try
{
if (stmnt != null)
stmnt.close();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}




Archive powered by MHonArc 2.6.24.

Top of Page