[freetds] FreeTds JDBC driver

Eyal Yekutiel eyal at e4x.com
Thu Jun 19 09:16:52 EDT 2003


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();
                }
            }



More information about the FreeTDS mailing list