Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: trouble con...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 11 Topic 3700 of 3876
Post > Topic >>

Re: trouble connecting to mysql

by =?ISO-8859-1?Q?Arne_Vajh=F8j?= <arne@[EMAIL PROTECTED] > Apr 8, 2008 at 10:24 PM

naveen wrote:
>>> though i have tried putting database as //localhostneo also
>>>  but this didnt work too
> 
> well i am soory ..my mistake i meant //localhost/neo

As a general rule: copy paste when you post to avoid typos.

> <%
> String varSql = request.getParameter("sql");
> if (varSql == null) {
>     varSql = "";
> }
> varSql = java.net.URLDecoder.decode(varSql).trim();
> %>
> ...
> <%
> String dbURL="jdbc:mysql://localhost/neo";
> String username="root";
> String passwd="abc";
> try{
>  Class.forName("com.mysql.jdbc.Driver");
>  Connection conn=DriverManager.getConnection(dbURL,username,passwd);
>  Statement stat=null;
>  try{
>   stat=conn.createStatement();

>  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:1096)
> 	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:626)
> 	at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562)
> 	at com.mysql.jdbc.Connection.(Connection.java:491)
> 	at
> com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:
> 346)
> 	at java.sql.DriverManager.getConnection(Unknown Source)
> 	at java.sql.DriverManager.getConnection(Unknown Source)
> 	at org.apache.jsp.HelloMysql_jsp._jspService(HelloMysql_jsp.java:98)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

You have loaded the driver OK, you have established a TCP connection
to the server OK, but the JDBC driver and the MySQL server will not
talk to each other. It look like the MySQL server closes the connection.

Check that the JDBC driver you are using are newer than the MySQL
server version you are using.

Check in the MySQL side for errors.

Arne
 




 11 Posts in Topic:
trouble connecting to mysql
naveen <naveen.cse217@  2008-04-06 10:03:41 
Re: trouble connecting to mysql
=?ISO-8859-1?Q?Arne_Vajh=  2008-04-06 15:07:58 
Re: trouble connecting to mysql
Lew <lew@[EMAIL PROTEC  2008-04-06 15:54:55 
Re: trouble connecting to mysql
naveen <naveen.cse217@  2008-04-07 02:28:27 
Re: trouble connecting to mysql
=?ISO-8859-1?Q?Arne_Vajh=  2008-04-07 21:40:57 
Re: trouble connecting to mysql
"joeNOSPAM@[EMAIL PR  2008-04-07 09:23:31 
Re: trouble connecting to mysql
naveen <naveen.cse217@  2008-04-08 19:05:48 
Re: trouble connecting to mysql
=?ISO-8859-1?Q?Arne_Vajh=  2008-04-08 22:24:21 
Re: trouble connecting to mysql
naveen <naveen.cse217@  2008-04-09 06:02:49 
Re: trouble connecting to mysql
Lew <lew@[EMAIL PROTEC  2008-04-09 19:52:50 
Re: trouble connecting to mysql
naveen <naveen.cse217@  2008-04-10 11:56:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 22:24:10 CST 2008.