• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Removing Eclipse Ganymede

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anybody help me with removing Eclipse Ganymede?
Because of problems with installing the MySQL JDBC driver and nobody seems to have an answer for this problem, the only solution that remains, is removing and reinstalling Eclipse . I want to remove Eclipse with leaving no traces anymore of the program. So when I reinstall Eclipse, there can be no conflict anymore with installing the MySQL JDBC driver. Thanks for Your help.

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

just remove the directory Eclipse is installed.

If you also want to clean-up the workspace you are using start Eclipse with the flag -clean after you have re-installed it.

Best regards, Lars
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've removed the Eclipse-map and reinstalled Eclipse Ganymede again. I still get the same failure announcements as before: I can't install MySQL JDBC driver. What can I do More?
 
Lars Vogel
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What problem do you face with the SQL Driver?
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,

Thanks a lot for Your help. I have a topic MySQL JDBC driver in forum JDBC where I explain everything what I get.
I get everytime that their isn't a driver available, and when I install a driver I get that their is already one available. So i have a SQL problem
: Communications link failure.

If You could help me with solving this problem a bottle of champagne is Yours.

Thanks forward.


Emmanuel Waûters
 
Lars Vogel
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds weird.

You may want to give Eclipse DTP a try. The following tutorial is based on Apache Derby but I would assume that once you have done this, you should be able to adapt it for MySQL.

http://www.vogella.de/articles/EclipseDataToolsPlatform/article.html

MySQL server crashes if I try to install in on my machine so I can unfortunately not try with MySQL.

 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,

I'lll trie to fix it with Your explaination. I have wrote some code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectDB {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.
getConnection("jdbc:mysql://localhost/bierendb","root", "");
System.out.println("Connection OK");
con.close();
} catch (ClassNotFoundException e) {
System.out.println("JDBC driver niet aanwezig");
} catch (SQLException e) {
System.out.println("SQL probleem");
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}

and got as output in the console the following:

SQL probleem
Communications link failure

Last packet sent to the server was 0 ms ago.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2120)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:723)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at ConnectDB.main(ConnectDB.java:10)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2043)
... 12 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:209)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:253)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
... 13 more


 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Emmanuel Waûters wrote:I've removed the Eclipse-map and reinstalled Eclipse Ganymede again. I still get the same failure announcements as before: I can't install MySQL JDBC driver.



Of course, I'm sorry someone gave you that bad advice. Uninstalling and reinstalling anything almost never makes sense, and rarely works.

Anyway, the error trace you've shown us very clearly illustrates that the driver is installed correctly, but there's no database server running on localhost on the default port. Have you started mysqld? Can you talk to it using the "mysql" command-line tool?
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,


Thanks too for Your help. I opened MySQL database and went to the MySQL Query Browser to trie some entered queries and used them in going trough some databases I put in MySQL, and they succeeded. So they have to work and I think MySQL works well.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you by any chance change the port MySQL uses? You can check this by going into the mysql command line tool and entering:

show variables like 'port';

Or if you prefer, in the MySQL Administrator the port is shown on the Server Information page. If it says anything other than 3306 then you must change the connection URL in your app to include that port.

Oh, and just as a sanity check - your Java app is running on the same system as MySQL, right?
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo,

Thanks for the help You offering me. MySQL indicates that the Server Host is localhost, the Port is 3306 and the Stored Connection is empty. When I start and log in, I see the main page where is written MySQL server is running. When I push the button catalogs, I see the database I need: bierendb.
When I choose MySQL at Connection Profile Types from Database Connections , I fill in at Name BierenLocalHost and let Descripton blank. Then I get at Specify a Driver and Connections Details for Database: Database, for URL: jdbc:mysql://localhost:3306/database User name: root. Maybe I have to change here something?

Thanks forward.


Emmanuel


 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What OS? What version of MySQL? And what is the name of the MySQL JDBC driver JAR file?

I ran you code on my PC (changed the URL to match one of my existing databases) and it worked. Here is my environment:

Windows Vista Professional
MySQL 5.1.35 (community)
mysql-connector-java-5.1.6.jar
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)

Also, see if any of this helps: http://ubuntuforums.org/showthread.php?t=897729
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MySQL 5.1.34-community via TCP/IP
Windows Vista Business
Java(TM) 6 Standard Edition Version 6 Update 13 (build 1.6.0_13-b03)

When I looked and choose the driver :

MySQL JDBC Driver MySQL 5.1.


I got as answer :

Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-5.1.0-bin.jar.

When I looked further, I see this jar-file:
mysql-connector-java-5.1.0-bin.jar
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post the contents of your c:/windows/system32/drivers/etc/hosts file.

Also, please use either "netstat -ab" or tcpview to see which port(s) mysql has open. On my system, netstat gives:



Also, do you have both IPv4 and IPv6 protocols set up for your network connection?
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the content of the c:/windows/system32/drivers/etc/hosts file

# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host


::1 localhost


Where I have to fill in either "netstat -ab" or tcpview to see which port(s) mysql has open?

Where could I find this - and what does it means -: both IPv4 and IPv6 protocols set up for my network connection??

I'm a bit new into the programming world.

Thanks forward,

Emmanuel
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

::1 localhost



You hosts file has only the IPv6 address for localhost. Add the IPv4 address to it so that you have:



Then see if that solves the problem. You should not need to reboot, but it can't hurt.

Where I have to fill in either "netstat -ab"



From a command prompt.

Where I have to fill in either ... or tcpview



Let me google that for your: tcpview

Where could I find this - and what does it means -: both IPv4 and IPv6 protocols set up for my network connection??



In XP, the network config settings were easy to find. In Vista Microsoft did it's darndest to hide those config setting behind a myriad of dialog boxes, but you can find them by following this trial:
Start Menu > Connect To, then click "Open Network and Sharing Center", then click "Manage Network Connections" (I keep a shortcut to this on my laptop's desktop). Right click on your network connection and select Properties. You will get a list of features enabled on the network; see if both IPv4 and IPv6 are enabled like in this screenshot:


xxx.png
[Thumbnail for xxx.png]
Network connection properties
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dear Mister,


Very much thanks for all the help You offer me. If you can help me to manage and resolve my problem, some belgian specialities are Yours.

So here is what I got from tcpview:

Adobe Media Player.exe:2168 TCP pc_van_emmanuel.telenet.be:51913 192.150.18.118:http CLOSE_WAIT
Adobe Media Player.exe:2168 TCP pc_van_emmanuel.telenet.be:51914 wwis-dubc1-vip60.adobe.com:http CLOSE_WAIT
AtService.exe:1024 TCP PC_van_Emmanuel:5550 PC_van_Emmanuel:0 LISTENING
AtService.exe:1024 TCP PC_van_Emmanuel:5550 localhost:49212 ESTABLISHED
cssauth.exe:3564 TCP PC_van_Emmanuel:49212 localhost:5550 ESTABLISHED
fsaua.exe:3656 TCP PC_van_Emmanuel:12110 PC_van_Emmanuel:0 LISTENING
fsaua.exe:3656 UDP PC_van_Emmanuel:12110 *:*
fsorsp.exe:3672 TCP pc_van_emmanuel.telenet.be:52028 217.110.97.201:http CLOSE_WAIT
fsorsp.exe:3672 UDP PC_van_Emmanuel:53906 *:*
iexplore.exe:1368 UDP PC_van_Emmanuel:56083 *:*
iexplore.exe:4152 UDP PC_van_Emmanuel:65290 *:*
iexplore.exe:8368 UDP PC_van_Emmanuel:60354 *:*
jusched.exe:4060 TCP pc_van_emmanuel.telenet.be:49386 a92-122-217-139.deploy.akamaitechnologies.com:http CLOSE_WAIT
lsass.exe:756 TCP PC_van_Emmanuel:49155 PC_van_Emmanuel:0 LISTENING
lsass.exe:756 TCPV6 pc_van_emmanuel:49155 pc_van_emmanuel:0 LISTENING
msnmsgr.exe:2204 TCP pc_van_emmanuel.telenet.be:51931 by2msg3010809.phx.gbl:msnp ESTABLISHED
msnmsgr.exe:2204 TCP PC_van_Emmanuel:51934 PC_van_Emmanuel:0 LISTENING
msnmsgr.exe:2204 TCP PC_van_Emmanuel:51934 localhost:51935 ESTABLISHED
msnmsgr.exe:2204 TCP PC_van_Emmanuel:51935 localhost:51934 ESTABLISHED
msnmsgr.exe:2204 UDP pc_van_emmanuel.telenet.be:discard *:*
msnmsgr.exe:2204 UDP PC_van_Emmanuel:51395 *:*
msnmsgr.exe:2204 UDP PC_van_Emmanuel:60786 *:*
mysqld.exe:2832 TCP PC_van_Emmanuel:3306 PC_van_Emmanuel:0 LISTENING
services.exe:744 TCP PC_van_Emmanuel:49171 PC_van_Emmanuel:0 LISTENING
services.exe:744 TCPV6 pc_van_emmanuel:49171 pc_van_emmanuel:0 LISTENING
sidebar.exe:2892 UDP PC_van_Emmanuel:55537 *:*
Skype.exe:3728 UDP PC_van_Emmanuel:54328 *:*
sqlbrowser.exe:3052 UDP PC_van_Emmanuel:ms-sql-m *:*
sqlbrowser.exe:3052 UDPV6 pc_van_emmanuel:1434 *:*
svchost.exe:1060 TCP PC_van_Emmanuel:epmap PC_van_Emmanuel:0 LISTENING
svchost.exe:1060 TCPV6 pc_van_emmanuel:135 pc_van_emmanuel:0 LISTENING
svchost.exe:1188 TCP PC_van_Emmanuel:49153 PC_van_Emmanuel:0 LISTENING
svchost.exe:1188 TCPV6 pc_van_emmanuel:49153 pc_van_emmanuel:0 LISTENING
svchost.exe:1280 TCP PC_van_Emmanuel:49154 PC_van_Emmanuel:0 LISTENING
svchost.exe:1280 UDP PC_van_Emmanuel:isakmp *:*
svchost.exe:1280 UDP PC_van_Emmanuel:ipsec-msft *:*
svchost.exe:1280 TCPV6 pc_van_emmanuel:49154 pc_van_emmanuel:0 LISTENING
svchost.exe:1280 UDPV6 pc_van_emmanuel:500 *:*
svchost.exe:1536 UDP PC_van_Emmanuel:ntp *:*
svchost.exe:1536 UDP PC_van_Emmanuel:ssdp *:*
svchost.exe:1536 UDP pc_van_emmanuel.telenet.be:ssdp *:*
svchost.exe:1536 UDP pc_van_emmanuel.telenet.be:52613 *:*
svchost.exe:1536 UDP PC_van_Emmanuel:52614 *:*
svchost.exe:1536 UDPV6 pc_van_emmanuel:123 *:*
svchost.exe:1536 UDPV6 [0:0:0:0:0:0:0:1]:1900 *:*
svchost.exe:1536 UDPV6 [fe80:0:0:0:34d9:d10:ab39:75d]:1900 *:*
svchost.exe:1536 UDPV6 [fe80:0:0:0:80cd:23f7:de16:d717]:1900 *:*
svchost.exe:1536 UDPV6 [fe80:0:0:0:fc65:ca48:e9aa:fdf4]:1900 *:*
svchost.exe:1536 UDPV6 [fe80:0:0:0:fc65:ca48:e9aa:fdf4]:52609 *:*
svchost.exe:1536 UDPV6 [fe80:0:0:0:80cd:23f7:de16:d717]:52610 *:*
svchost.exe:1536 UDPV6 [0:0:0:0:0:0:0:1]:52611 *:*
svchost.exe:1536 UDPV6 [fe80:0:0:0:34d9:d10:ab39:75d]:52612 *:*
svchost.exe:1644 UDP PC_van_Emmanuel:llmnr *:*
svchost.exe:1644 UDPV6 pc_van_emmanuel:5355 *:*
System:4 TCP pc_van_emmanuel.telenet.be:netbios-ssn PC_van_Emmanuel:0 LISTENING
System:4 TCP PC_van_Emmanuel:microsoft-ds PC_van_Emmanuel:0 LISTENING
System:4 TCP PC_van_Emmanuel:5357 PC_van_Emmanuel:0 LISTENING
System:4 UDP pc_van_emmanuel.telenet.be:netbios-ns *:*
System:4 UDP pc_van_emmanuel.telenet.be:netbios-dgm *:*
System:4 TCPV6 pc_van_emmanuel:445 pc_van_emmanuel:0 LISTENING
System:4 TCPV6 pc_van_emmanuel:5357 pc_van_emmanuel:0 LISTENING
tvttcsd.exe:3148 TCP PC_van_Emmanuel:6060 PC_van_Emmanuel:0 LISTENING
wininit.exe:700 TCP PC_van_Emmanuel:49152 PC_van_Emmanuel:0 LISTENING
wininit.exe:700 TCPV6 pc_van_emmanuel:49152 pc_van_emmanuel:0 LISTENING
wlcomm.exe:5468 UDP PC_van_Emmanuel:49864 *:*


IPv6 and IPv4 were both already enabled. But I saw that if I look to the LAN-connection the networkcable is not connected. Maybe that has something to do with it?
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,


If I stand on the IPv6 and push the button Properties I see that the IP-adress that the IPv6-adress is received automatically and the DNS-serveradress is asseigned automatically too. If I do the same for IPv4 I get as
IP-address 192.168.254.4 and
Subnetmasker 255.255.255.0 and
Standard gateway 192.168.254.254

Preference-DNS-server 195.238.2.21
Alternative-DNS-server 195.238.2.22

Thanks forward,

Emmanuel
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,


I looked to what you writed about installing the MySQL JDBC driver. I did the same as You did but ping connection didn't succeed in my Eclipse .

I got:

Could not connect to BierenLocalHost.
Error creating SQL Model Connection connection to BierenLocalHost. (Error: Communications link failure

Last packet sent to the server was 0 ms ago.)
Communications link failure

Last packet sent to the server was 0 ms ago.
Error creating JDBC Connection connection to BierenLocalHost. (Error: Communications link failure

Last packet sent to the server was 0 ms ago.)
Communications link failure

Last packet sent to the server was 0 ms ago.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to this:
mysqld.exe:2832 TCP PC_van_Emmanuel:3306 PC_van_Emmanuel:0 LISTENING
MySQL has port 3306 open. So I think it is a hostname/IP address issue - the error messages from Eclipse seem to bear this out. (Typically, a Java client will connect to a host with the name or IP address you give it, the host will reply with its hostname, and then the client will use that hostname for further communication. If the hostname returned is mapped to no IP address or has the wrong IP address, then things just don't work. Note that this is a quirk of some Java clients, and thus could explain when a Java app cannot connect to the database, by the MySQL Admin can connect.)

What is the IP address of BierenLocalHost?

What do you get if you enter "ipconfig /all" on the commandl ine?

Did you update the hosts file like I asked?
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,



Could I send the answers on Your questions by mail. I've made some screenshots and don't know how to post them here. I think maybe we've find the fault. The localhost of the database isn't 3306, it's another port . I think maybe it's that. I would like to send You all this screenshots.



Thanks very, very, very much.


Emmanuel.
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,



Could I send the answers on Your questions by mail. I've made some screenshots and don't know how to post them here. I think maybe we've find the fault. The localhost of the database isn't 3306, it's another port . I think maybe it's that. I would like to send You all this screenshots.



Thanks very, very, very much.


Emmanuel.
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,



Could I send the answers on Your questions by mail. I've made some screenshots and don't know how to post them here. I think maybe we've find the fault. The localhost of the database isn't 3306, it's another port . I think maybe it's that. I would like to send You all this screenshots.



Thanks very, very, very much.


Emmanuel.
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,

my emailadress is wauters underscore emmanuel at hotmail dot com All without spaces.


Thanks,


Emmanuel
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Could I send the answers on Your questions by mail.


http://faq.javaranch.com/java/UseTheForumNotEmail
Besides, I cannot answer direct email unless you have a support contract with my company, and even then you have to go through proper channels.

I've made some screenshots and don't know how to post them here.


Have you seen the Attachments tab underneath the editor window?

The localhost of the database isn't 3306, it's another port .


Huh? Did you mean "The port of...'' Or do you mean that the database is not listening on localhost but rather on your PC's hostname, which I think is PC_van_Emmanuel? There is no need to send screen shots for this. In TCPView you can save the info to a text file (please post only the mysqld line!). And netstat output is also textual.

If mysqld is really attached to PC_van_Emmanuel:3306, then just change your *-ds.xml file to reflect this.
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,

My excuses for asking You to mail. I'm very new to this forum, more, I'm very new into the ICT-business and programming. I just started a very intensive course end of april last, but I'm loving it.The harder it is, the more I like it.

I've hosted the screenshots on Picasa Web Albums. This is the link: Screenshots PC
I will type here the text of my mail with the reference to the screenshots in between.

Screenshot1
Screenshot2


Here are some IP-addresses communicated to my by the system. In the left menu You find the button “Catalogs” where my databases are – so too bierendb-. But I don't know how to find out which IP-address bierendb has.



In Database i've found nothing filled in.


Screenshot3
Screenshot4


Adapter for wireless LAN Wireless networkconnection
MediumStatus.......................................:medium disconnected
Connectionspecification. DNS-postfix: telenet.be

Ethernet-adapter LAN-connection:
Mediumstatus..........................: medium disconnected
Connectionspecification. DNS-postfix:

Tunnel-adapter LAN-connection*7:
Mediumstatus..........................: medium disconnected
Connectionspecification. DNS-postfix:

That's what I get by typing ipconfig. But can't type ipconfig /all. In the map System32 of Windows I only get ipconfig.

Screenshot5
Screenshot6

I think here You see the the localhost of bierendb is not 3306. I don't find where the IP-address is. Don't know how to find it. So I think that is the problem. How can I change that?


I found both Ipv4 and Ipv6 enabled but how I have to add Ipv4 address for localhost or how i have top update hosts file don't know how to do it.


So that is what I found out. If You need more information, ask me. I will try to get it. Please be awre I'm new, so sometimes I need a guide to find this information out.

Another time much thanks for willing to help me so much.

I'm always willing to do a favour to You also and will not forget my promesse when we resolve my problem.

Thanks forward.




Emmanuel Waûters
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo Mister Johnson,


Did my information helped to solve the problem?


Thanks forward.


Emmanuel
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I looked at the photos and it does look like MySQL is binding to localhost:3306. But I don't like the response from ipconfig - where are the IP addresses? Is your system plugged into the network? Also, you should be able to type 'ipconfig /all', the '/all' is simply an option to ipconfig.

I double-checked the version of the JDBC driver. The latest is mysql-connector-java-5.1.8-bin.jar. You might try downloading and using that one.
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mr. Johnson,


I downloaded the last version of the driver- so a driver that is diiferent of the former driver-.And again I got the same notifications as before.

In green are the links or buttons I clicked on.
In red is the text I wrote in the blank spaces.
In black, italic the text I get : the menu, problemnotifications,....

Java EE

Data Source Explorer

I marked “Database Connections” and open with the right mousekey the menu and clicked on “New
Connection Profile
Create a DB2 for Linux, UNIX, and Windows connection profile.
Connection Profile Types:
MySQL
Name: ( Where I put in the next line)
BeersLocalHost
Next>'

Specify a Driver and Connection Details
Select a driver from the drop-down and provide login details for the connection.
Drivers: MySQL JDBC Driver [+] (I clicked on this button “New Driver Definition”)

Specify a Driver Template and Definition Name
Name/Type
MySQL JDBC Driver MySQL 5.1
First I get this answer:
Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-5.1.0-bin.jar.
Jar List
I remove mysql-connector-java-5.1.0.-bin.jar and loose notification:
Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-5.1.0-bin.jar.
When I then want to install the driver “C:\Users\Emmanuel\Contacts\Documents\Programma's\mysql-connector-java-5.1.8\mysql-connector-java-5.1.8\mysql-connector-java-5.1.8-bin.jar” I get :
A driver already exists with that name. Please provide a unique driver name
I can't push then the button “ok”, but just can push the button “cancel”.
If I trie again and this time I do the following steps:

Specify a Driver and Connection Details
Select a driver from the drop-down and provide login details for the connection.
Drivers: MySQL JDBC Driver [+] (I clicked on this button “New Driver Definition”)

Specify a Driver Template and Definition Name
Name/Type
MySQL JDBC Driver MySQL 5.1

First I get this answer:
Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-5.1.0-bin.jar.
Jar List
I let the file “mysql-connector-java-5.1.0.-bin.jar “ as it is and add the next file
“C:\Users\Emmanuel\Contacts\Documents\Programma's\mysql-connector-java-5.1.8\mysql-connector-java-5.1.8\mysql-connector-java-5.1.8-bin.jar” to and I get following notification :
A driver already exists with that name. Please provide a unique driver name.
So in both cases I get as answer – even if the driver is in the list - their isn't a driver available and when I want to remove the driver and/or add a new driver to it I get as answer the driver already exists.


When I typed the commando ipconfig /all, I get the folowing response.

Please look at the screenshots 7,8,9.



Thanks forward.


Emmanuel Waûters
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please ignore Eclipse for now. I want to first make sure that you can run the Java app you posted on July 22. If that app will not run then anything we attempt to do in Eclipse will be futile.

So here is what I want you to do. Run the Java client from July 22 from a command line and tell me if that works. Don't forget to include the MySQL JDBC JAR file in your classpath.
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo,

I've retyped the javafile of 22th of july in notepad and want it now to run. Do I have to fill in somewhere in that file the absolute adress of the MySQL JDBC JAR file ?
How would the commando looks like that I have to use in the command line, where is the MySQL JDBC JAR file included? I would save the jarfile in the same map as my java-file, so with the classpath it will be both compiled.
If I have to do more difficult things. I can ask other students next monday, buth not for resolving this JDBC problem. I already asked them and the theacher also. But they can help me providing You the exact information you requested me.

Thanks forward.


Emmanuel
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do not use notepad!!! It does strange things that, unless you are aware of them, will cause you more problems. If you need a basic text editor, download and install Notepad++.

Why did you retype the client code? Why did you not just use the one created by Eclipse? What I was trying to get you to do was not fiddle around with the database connection within Eclipse or even run the app within Eclipse.

Also, are you saying that you are learning Java by working entirely in the Eclipse environment? I would not do it that way. I would make you use a simple text editor (like Notepad++) to write your code (and configuration files) and use the command line to compile, package and run your apps. Until you could do that with your eyes closed, and you learned about Ant and Maven for building and packaging, I would not let you near an IDE. I suggest that you google for some basic Java tutorials. Here's one from Sun: http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After you look at that tutorial, try compiling and running your client app from the command line. If you run into problems, post the full path name for your client's .java source file, the working directory for your command line, the command entered, and the error. Simply copy and paste that info from the command line window to the forum.
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mister,


So I followed Your instructions. I've typed the following text in notepad++ :
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectDB {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.
getConnection("jdbc:mysql://localhost/bierendb","root", "");
System.out.println("Connection OK");
con.close();
} catch (ClassNotFoundException e) {
System.out.println("JDBC driver not found");
} catch (SQLException e) {
System.out.println("SQL problem");
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}

I saved the file as C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen\src\ConnectDB.java .
I copied the file mysql-connector-java-5.1.7-bin.jar into this map
C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen\src

and into this map :
C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen\build

and that is what I got when I compiled and runned the program.




Thanks forward.



Emmanuel
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why couldn't you copy and paste the text from the command prompt window to the forum like I asked you? Then I could easily quote the things you did wrong and show you how to correct them.

Of the 4 javac command you ran, only one worked. Guess what - the one that worked is the correct one (I'd quote it for you but I am not about to retype the text...)

You tried only one java command. The error is because you did not include the JDBC JAR file in the classpath:

java -cp build;build/mysql-connector-java-5.1.7-bin.jar ConnectDB

Notice that when you specify a directory in the classpath that the JVM will search only for class files - it does not search for JAR files. If you want to include a JAR file you have to name it in the classpath. This is a 'quirk' that has confused many and rumor has it that a future version of the JVM will rectify this.

 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo,

I found out how to copy – can only copy everything or nothing - text from the command line. So I typed again the commando's You suggested and got this:


Microsoft Windows [versie 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. Alle rechten voorbehouden.


C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen>javac -d b
uild src/ConnectDB.java

C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen>java -cp b
uild;build/mysql-connector-java-5.1.7-bin.jar ConnectDB
JDBC driver not found

C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen>java -cp b
uild;build/mysql-connector-java-5.1.7-bin.jar ConnectDB
JDBC driver not found

C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen>

I compared today everything to another student: I compared what he writes, markes, fills in, chooses in MySQL and Eclipse. I've done the same things. We've looked to everything: every map, file and we've got the same. But always I can't get connected with the database.
And now when I see what I've got – JDBC driver not found - from the command line – after compiled and run the little application – and know I've copied the jar-file to the src- and the builddirectory and even copied it to the parentdirectory of both, I start to think my computer or some system on my computer can't read the jar-file, can't acces it. It exists but the application don't find it. I've worked once in the system- and the environement-variables, I hope it has not got any implications.


Thanks forward.



Emmanuel Waûters
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo,


It seems to have something to do with my system Window Vista Business.
Here is the link where is a similar problem. This persons system worked fine , until an update of windows: "Probably after an update of Windows Defender in Windows Vista the JDBC connection to MySQL has given up working, even for applications that have always worked until now."

So it has something to do with windows.

Thanks,


Emmanuel
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would agree that Windows Defender could be an issue, except that you can get the MySQL Admin GUI to connect. So getting connected is possible.

Let's look at this command and its result:



In an earlier post you stated:

I copied the file mysql-connector-java-5.1.7-bin.jar into this map
C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen\src

and into this map :
C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen\build



Is the mysql-connector-java-5.1.7-bin.jar file in the build directory? Try running this from the command prompt, and paste the reply:



One more thing. Add a printStackTrace call to the CNFE:



By the way, it is not true that you have to copy and paste the whole command prompt window contents. You can select the text to copy with the mouse and then either right-click (if you have Quick Edit Mode set) or go to the system menu and select Edit > Copy.
 
Emmanuel Waûters
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo,

I made an mistake before. The jar-file wasn't included in the build directory. Now it is and I've included e.printStackTrace() in the java-file as demanded.
So that is what I got:

C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen>javac -d b
uild src/ConnectDB.java

C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen>java -cp b
uild;build/mysql-connector-java-5.1.7-bin.jar ConnectDB
SQL problem
Communications link failure

Last packet sent to the server was 0 ms ago.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link fai
lure

Last packet sent to the server was 0 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1
074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2120)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:723)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:282)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at ConnectDB.main(ConnectDB.java:9)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communicatio
ns link failure

Last packet sent to the server was 0 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1
074)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2043)
... 12 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:209)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
va:253)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
... 13 more

C:\Users\Emmanuel\Contacts\Documents\Informatica\Java\SCJP-oefeningen>


Thanks forward,


Emmanuel
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try one more thing. Change the connection URL to:

getConnection("jdbc:mysql://localhost:3306/bierendb","root", "");

Also, what is the 'root' password for MySQL? Did you really leave it blank? If not, provide the password also:

getConnection("jdbc:mysql://localhost:3306/bierendb","root", "thepassword");
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic