473,854 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

jdbc createConnectio n(String url) throws exception

2 New Member
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:14 33/PSS?user=test&p assword=test1&u seReadAheadInpu t=false&useUnbu fferedInput=tru e");
String driverClass = "org.gjt.mm.mys ql.Driver";

Class.forName(d riverClass);
Connection connection = DriverManager.g etConnection(ur l);
-------------------
Here is the entire exception:
SQLException: 0:Communication s link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

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

** BEGIN NESTED EXCEPTION **

java.net.Socket Exception
MESSAGE: Connection reset

STACKTRACE:

java.net.Socket Exception: Connection reset
at java.net.Socket InputStream.rea d(Unknown Source)
at com.mysql.jdbc. MysqlIO.readFul ly(MysqlIO.java :1953)
at com.mysql.jdbc. MysqlIO.readPac ket(MysqlIO.jav a:558)
at com.mysql.jdbc. MysqlIO.doHands hake(MysqlIO.ja va:1029)
at com.mysql.jdbc. Connection.crea teNewIO(Connect ion.java:2749)
at com.mysql.jdbc. Connection.<ini t>(Connection.j ava:1553)
at com.mysql.jdbc. NonRegisteringD river.connect(N onRegisteringDr iver.java:285)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at org.utah.traffi c.factory.Mysql ConnectionFacto ry.createConnec tion(MysqlConne ctionFactory.ja va:13)
at org.utah.traffi c.dlConv.test.D lTest.main(DlTe st.java:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.

STACKTRACE:

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

** BEGIN NESTED EXCEPTION **

java.net.Socket Exception
MESSAGE: Connection reset

STACKTRACE:

java.net.Socket Exception: Connection reset
at java.net.Socket InputStream.rea d(Unknown Source)
at com.mysql.jdbc. MysqlIO.readFul ly(MysqlIO.java :1953)
at com.mysql.jdbc. MysqlIO.readPac ket(MysqlIO.jav a:558)
at com.mysql.jdbc. MysqlIO.doHands hake(MysqlIO.ja va:1029)
at com.mysql.jdbc. Connection.crea teNewIO(Connect ion.java:2749)
at com.mysql.jdbc. Connection.<ini t>(Connection.j ava:1553)
at com.mysql.jdbc. NonRegisteringD river.connect(N onRegisteringDr iver.java:285)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at org.utah.traffi c.factory.Mysql ConnectionFacto ry.createConnec tion(MysqlConne ctionFactory.ja va:13)
at org.utah.traffi c.dlConv.test.D lTest.main(DlTe st.java:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.
at com.mysql.jdbc. MysqlIO.readPac ket(MysqlIO.jav a:626)
at com.mysql.jdbc. MysqlIO.doHands hake(MysqlIO.ja va:1029)
at com.mysql.jdbc. Connection.crea teNewIO(Connect ion.java:2749)
at com.mysql.jdbc. Connection.<ini t>(Connection.j ava:1553)
at com.mysql.jdbc. NonRegisteringD river.connect(N onRegisteringDr iver.java:285)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at org.utah.traffi c.factory.Mysql ConnectionFacto ry.createConnec tion(MysqlConne ctionFactory.ja va:13)
at org.utah.traffi c.dlConv.test.D lTest.main(DlTe st.java:54)


** END NESTED EXCEPTION **



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

** BEGIN NESTED EXCEPTION **

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

** BEGIN NESTED EXCEPTION **

java.net.Socket Exception
MESSAGE: Connection reset

STACKTRACE:

java.net.Socket Exception: Connection reset
at java.net.Socket InputStream.rea d(Unknown Source)
at com.mysql.jdbc. MysqlIO.readFul ly(MysqlIO.java :1953)
at com.mysql.jdbc. MysqlIO.readPac ket(MysqlIO.jav a:558)
at com.mysql.jdbc. MysqlIO.doHands hake(MysqlIO.ja va:1029)
at com.mysql.jdbc. Connection.crea teNewIO(Connect ion.java:2749)
at com.mysql.jdbc. Connection.<ini t>(Connection.j ava:1553)
at com.mysql.jdbc. NonRegisteringD river.connect(N onRegisteringDr iver.java:285)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at org.utah.traffi c.factory.Mysql ConnectionFacto ry.createConnec tion(MysqlConne ctionFactory.ja va:13)
at org.utah.traffi c.dlConv.test.D lTest.main(DlTe st.java:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.

STACKTRACE:

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

** BEGIN NESTED EXCEPTION **

java.net.Socket Exception
MESSAGE: Connection reset

STACKTRACE:

java.net.Socket Exception: Connection reset
at java.net.Socket InputStream.rea d(Unknown Source)
at com.mysql.jdbc. MysqlIO.readFul ly(MysqlIO.java :1953)
at com.mysql.jdbc. MysqlIO.readPac ket(MysqlIO.jav a:558)
at com.mysql.jdbc. MysqlIO.doHands hake(MysqlIO.ja va:1029)
at com.mysql.jdbc. Connection.crea teNewIO(Connect ion.java:2749)
at com.mysql.jdbc. Connection.<ini t>(Connection.j ava:1553)
at com.mysql.jdbc. NonRegisteringD river.connect(N onRegisteringDr iver.java:285)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at org.utah.traffi c.factory.Mysql ConnectionFacto ry.createConnec tion(MysqlConne ctionFactory.ja va:13)
at org.utah.traffi c.dlConv.test.D lTest.main(DlTe st.java:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.
at com.mysql.jdbc. MysqlIO.readPac ket(MysqlIO.jav a:626)
at com.mysql.jdbc. MysqlIO.doHands hake(MysqlIO.ja va:1029)
at com.mysql.jdbc. Connection.crea teNewIO(Connect ion.java:2749)
at com.mysql.jdbc. Connection.<ini t>(Connection.j ava:1553)
at com.mysql.jdbc. NonRegisteringD river.connect(N onRegisteringDr iver.java:285)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at org.utah.traffi c.factory.Mysql ConnectionFacto ry.createConnec tion(MysqlConne ctionFactory.ja va:13)
at org.utah.traffi c.dlConv.test.D lTest.main(DlTe st.java:54)


** END NESTED EXCEPTION **



Last packet sent to the server was 0 ms ago.:[Ljava.lang.Stac kTraceElement;@ 1cb25f1
Jun 4 '07 #1
2 4567
bevis
2 New Member
I was trying to connect to mssql server with mysql drivers. Works great with the correct drivers.
Jun 5 '07 #2
Motoma
3,237 Recognized Expert Specialist
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
7262
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 get the following error trace, DriverManager.initialize: jdbc.drivers = null JDBC DriverManager initialized SQLException: SQLState(08S01) {sql7=true, port=1433, user=sa, url=jdbc:inetdae7:US0211737-WP01:1433,
2
5292
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 create XML files out of the DB2 data using the XML collections method and SQL mapping. I successfully enabled my database, put the collection.dtd into DTD_REF, created a DAD file and enabled the collection (xcolltest01) using the OS/400 command...
2
1860
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 com.ibm.db2.jcc.b.SQLException: 5 at com.ibm.db2.jcc.b.ce.e(ce.java:1093)
8
16598
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. Using these everything works. But then I wanted to make sure that I was using the redistributable jars (type 4 ) available from ibm.com. So I downloaded them from ibm. But they blow up in my face.... I'm using db2jcc.jar and the license file...
7
69120
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 rely on 'set schema xyz', hence the need to set the default via the jdbc url. Thanks. natG
3
22846
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, what are my options? Will I have to install db2 connect on every client machine that needs to connect to the DB2 servers? Is the DB2 Connect freely available or will we have to purchase it? I have also read on this group that we can install DB2...
2
6673
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 connect fine using db2connect and run queries etc. The problem is when I try to use my java application to connect using the same DSN. The way the db has been configured is that I am
0
6532
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 Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is...
1
2705
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 production databases and I've cataloged the same database (of course with the same name) in both instances (these instances and databases have correspondents on the server). I'm using for my Java tests the application driver...
0
9899
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9750
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11023
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10672
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9509
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4147
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.