473,856 Members | 1,644 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 4568
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
6674
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
9904
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
11049
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...
1
10772
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7928
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5754
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5956
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4568
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
4169
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3195
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.