• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Error in connection

 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am using Mysql 4.1.11 on windows....and i wrote a piece of code for getting a connection but iam getting an error...

===============Code======================


but i get the following exception error...


==============Error====================

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 Connection.JdbcConnMysql.main(JdbcConnMysql.java:29)


** END NESTED EXCEPTION **


at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:692)
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 Connection.JdbcConnMysql.main(JdbcConnMysql.java:29)


Can you let me know where i was wrong...

Tx in advance,
Regards
[ May 21, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In general, "Unexpected end of input stream" is usually not a code problem, unless the process at "systemname:3306" isn't really a MySQL database.

More likely, it's one of:
1) using an older MySQL driver with a newer MySQL database
Latest stable driver here:
http://dev.mysql.com/downloads/connector/j/3.1.html
2) an intervening network device (e.g. firewall)
3) a broken/corrupt MySQL database
4) an OS level problem, either local or remote
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Stu!!!...Your suggestion worked...


In general, "Unexpected end of input stream" is usually not a code problem, unless the process at "systemname:3306" isn't really a MySQL database.

More likely, it's one of:

1) using an older MySQL driver with a newer MySQL database

Latest stable driver here:
http://dev.mysql.com/downloads/connector/j/3.1.html
2) an intervening network device (e.g. firewall)
3) a broken/corrupt MySQL database
4) an OS level problem, either local or remote



I was using 3.0.7 version previuosly...now 3.1.12..


Regards
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic