Unexpected end of input stream

Status
Nicht offen für weitere Antworten.
N

nedory

Gast
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?
 
N

nedory

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

nedory

Gast
Could you tell me more details, please? I do not know how I can try to use another connector.
 
Status
Nicht offen für weitere Antworten.

Ähnliche Java Themen

Neue Themen


Oben