# Unexpected end of input stream



## nedory (15. Feb 2006)

Hallo,
I have this code:
//--------------------------------------------------------------------
try {
Class.forName("com.mysql.jdbc.Driver");

String url = "jdbc:mysql://localhost:3306/database1";

Connection con = DriverManager.getConnection(url,"root","dan");
}catch( Exception e )
//--------------------------------------------------------------------------
and "Connection con = DriverManager.getConnection(url,"root","dan");" always throws this exception:
java.sql.SQLException: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream

** BEGIN NESTED EXCEPTION ** 

java.io.IOException
MESSAGE: Unexpected end of input stream

STACKTRACE:

java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1080)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:619)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
at com.mysql.jdbc.Connection.<init>(Connection.java:486)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:326)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Jdbc11.main(Jdbc11.java:94)


** END NESTED EXCEPTION **

Please, could you tell me where is problem?


----------



## André Uhres (15. Feb 2006)

Simultaneous connections?


----------



## nedory (16. Feb 2006)

I think no, this is only "hallo world" program with only one thread.


----------



## André Uhres (16. Feb 2006)

Maybe try another connector version.


----------



## nedory (16. Feb 2006)

Could you tell me more details, please? I do not know how I can try to use another connector.


----------



## André Uhres (16. Feb 2006)

Look at www.mysql.com --> downloads --> drivers and connectors


----------

