472,373 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

jdbc createConnection(String url) throws exception

2
I'm new to sql server and mysql but this seems like it should be a pretty straight forward jdbc connection. But I have spent almost 2 days just trying to get a jdbc connection. Please help if you can.

I'm using Eclipse 3.2.2 and I have installed mysql-connector-java-5.0.6-bin.jar. I am trying to connect to SQL Enterprise Manager version 8.0 innstall on a Windows 2003 Server Enterprise Edition.

I have been able to successfully test connectivity using Windows ODBC Data Sources so I know the connection parameters are correct. The test app throws an exception on getConnection;

------------------
String url = "jdbc:mysql://168.177.1.89:1433/PSS?user=test&password=test1&useReadAheadInput=fal se&useUnbufferedInput=true");
String driverClass = "org.gjt.mm.mysql.Driver";

Class.forName(driverClass);
Connection connection = DriverManager.getConnection(url);
-------------------
Here is the entire exception:
SQLException: 0:Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1953 )
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:558 )
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:10 29)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.utah.traffic.factory.MysqlConnectionFactory.cr eateConnection(MysqlConnectionFactory.java:13)
at org.utah.traffic.dlConv.test.DlTest.main(DlTest.ja va:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.

STACKTRACE:

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1953 )
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:558 )
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:10 29)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.utah.traffic.factory.MysqlConnectionFactory.cr eateConnection(MysqlConnectionFactory.java:13)
at org.utah.traffic.dlConv.test.DlTest.main(DlTest.ja va:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:626 )
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:10 29)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.utah.traffic.factory.MysqlConnectionFactory.cr eateConnection(MysqlConnectionFactory.java:13)
at org.utah.traffic.dlConv.test.DlTest.main(DlTest.ja va:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 0 ms ago.:Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1953 )
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:558 )
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:10 29)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.utah.traffic.factory.MysqlConnectionFactory.cr eateConnection(MysqlConnectionFactory.java:13)
at org.utah.traffic.dlConv.test.DlTest.main(DlTest.ja va:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.

STACKTRACE:

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1953 )
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:558 )
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:10 29)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.utah.traffic.factory.MysqlConnectionFactory.cr eateConnection(MysqlConnectionFactory.java:13)
at org.utah.traffic.dlConv.test.DlTest.main(DlTest.ja va:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:626 )
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:10 29)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.utah.traffic.factory.MysqlConnectionFactory.cr eateConnection(MysqlConnectionFactory.java:13)
at org.utah.traffic.dlConv.test.DlTest.main(DlTest.ja va:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 0 ms ago.:[Ljava.lang.StackTraceElement;@1cb25f1
Jun 4 '07 #1
2 4434
bevis
2
I was trying to connect to mssql server with mysql drivers. Works great with the correct drivers.
Jun 5 '07 #2
Motoma
3,237 Expert 2GB
I was trying to connect to mssql server with mysql drivers. Works great with the correct drivers.
Thanks for posting the solution to your problem for others to see!
Jun 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Swami | last post by:
Hi, I have installed MQ SQL Server 2000 on my laptop and trying to use SPRINTA 2000 JDBC Driver (inetmssql.jar) to connect to the local db. I wrote a sample Java app to test the connection and I...
2
by: Marc Stiegele | last post by:
Hello, I have a problem with the IBM DB2 UDB XML Extender. I`m working on a iSeries 400 server (AS/400, V5R1) with a integrated DB2 (my client is NT 4.0 Service Pack 1 with JDK1.1.8). I want to...
2
by: Tom Davies | last post by:
Can anyone tell me how to find out what causes this error -- the message is not very revealing! I'm using DB2 8.1 fixpak 5 on Windows XP, using the Sun JDK 1.4.2. Thanks, Tom ...
8
by: deegs_ca | last post by:
So I had my jdbc db28.2 fix pack 9 client running because I had taken the jars from <DB2ROOT>/java folder from Enterprise Edition 8.2 fix pack 9, db2java.zip, db2jcc.zip, and the license jar. ...
7
by: natG | last post by:
Using the IBM Universal JDBC (Type 4) driver; Can one specify a default schema as part of the url? Some application servers do not allow sending a default sql command upon connection, so I can't...
3
by: Anoop | last post by:
Is it true that there are no type 4 jdbc drivers to connect to a DB2 server v7.1? The DB2 server is hosted on ACF2 (OS/390). We would be connecting from windows and solaris boxes. If it is true,...
2
by: anokun7 | last post by:
Hi, I am connecting to a DB2 v7.1 server from windows using JDBC type 2 (I figured out that type 4 is only for 8 and upwards). I used DB2 Connect to create a system DSN and seem to be able to...
0
by: neuraljay | last post by:
hi everyone. I am trying to build a jsp using webwork, hibernate and mysql. And right now I am doing its unit testing. Everytime I run the test I am getting this error: Error JDBC exception on...
1
by: Stefano Gibellini | last post by:
Hello all, I'm using DB2 UDB 7.2 on a Linux server and I've installed the DB2 client on my Windows 2000 machine. I've defined on my client two instances, one for test databases and one for...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.