Re: Is this a bug ?
Posted by: Mark Matthews
Date: December 20, 2004 03:27PM

R Lenard wrote:
> I'm using a PreparedStatement to request data from
> a non-existant table, and then I get this
> exception -
> java.sql.SQLException: Communication
> link failure message from server: "Unknown
> command"
> com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja
> va:1997)
> com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:11
> 67)
> com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java
> :1278)
> com.mysql.jdbc.Connection.execSQL(Connection.java:
> 2255)
> com.mysql.jdbc.PreparedStatement.executeQuery(Prep
> aredStatement.java:1586)
> org.apache.commons.dbcp.DelegatingPreparedStatemen
> t.executeQuery(Delegating
> PreparedStatement.java:92)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ
> e Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknow
> n Source)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Un
> known Source)
> java.lang.reflect.Method.invoke(Unknown Source)
> com.ibatis.common.jdbc.logging.PreparedStatementLo
> gProxy.invoke(PreparedSta
> tementLogProxy.java:51)
> $Proxy1.executeQuery(Unknown Source)
> ....
>
> This is with mysql-4.1.7 and connectorj-3.0.16
>
> Any ideas ?
>

A couple...First, why aren't you using Connector/J 3.1.x with MySQL-4.1.x? If you're using the newest MySQL server, and want to use all of it's features, and have the latest bug fixes, then you should be using the latest version of the JDBC driver as well.

> This is one part of the documentation that is
> sadly lacking - exception / error handling..
>

Hmm...there's a _whole_ multipage table in the docs that tells you what error conditions on the server will throw what SQLExceptions with given SQLStates...However 'unknown command' usually means something more serious is goofed up, like your network connection is flaky or you have a bad server build....as what the server is receiving is not what it expects.

Does this error go away if you use Connector/J 3.1.5? Does it go away if you use MySQL-4.0.x? Does this happen under load? Does it happen the very first time you try the query? What does the query look like? Unfortunately, a stack trace doesn't give much for anybody to go on :(

> Googling for this error message suggests there
> used to be a problem with non-existant tables and
> these queries, but surely that's fixed right ??

This error was only there if you used MySQL-4.1.x _and_ Connector/J 3.1.x afaik. Since you're not using Connector/J 3.1.x, seems like this is unrelated :(

-Mark

Options: ReplyQuote


Subject
Written By
Posted
December 19, 2004 09:22PM
Re: Is this a bug ?
December 20, 2004 03:27PM
December 20, 2004 03:42PM
December 20, 2004 05:13PM
December 21, 2004 07:12PM
December 21, 2004 07:52PM
December 21, 2004 09:32PM
December 21, 2004 09:43PM
December 21, 2004 10:13PM
December 21, 2004 10:28PM
December 21, 2004 11:38PM
December 21, 2004 11:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.