Skip to content

MySQL and JDBC

January 6, 2011

Yes, I have chosen the database finally. And played with it a lot. It was not very funny, but I got a good experience.

Downloaded MySQL: mysql-5.5.9-win32.msi from http://www.mysql.com/downloads/.

Using advices from here and from here chosed “complete installiation” and server configuration: “typical”. Suddenly a problem during configuring: an error “Error Nr. 1364 Field ‘authentication_string’ doesn’t have a default value……make sure you have opened the TCP port 3306 for connections…”.

Solution: I turned off firewall and Avira, read about that at the forum “I’d been having the “Can’t connect to MySQL server on localhost (10061)” issue for a couple of days trying to read through the posts here an there on how people solved the issue. Nothing was working for me. Found out I needed to open the port on the windows firewall (Windows NT SP2). But still was having no luck; I opened the port. Still a problem”. An error still appears. Then I decided not to do everything from the beginning, but to go on, using already installed pieces:  Start-all programs-MySql – MySQL server – mysql instance configuration window. This time success.

Then I used command promt and played with databases, users and all that stuff I did 4 years ago…

By the way! :) What a wonderful phrase I found:

“The Windows command line command “net stop beep” will turn off the beeping, and “net start beep” will turn on the beeping.”

And it works!

 

JDBC:

I started from the tutorial http://www.mastertheboss.com/hibernate/284-hibernate-jboss.html?start=1 for JDBC. And had a lot of errors and problems. In Eclipse: window-Show view-other-Hibernate-Hibernate configurations, open hierarchy by clicking on the “plus”  in that window, and suddenly an error appeared: “Error while opening console configuration. Reason: org.hibernate.console.HibernateConsoleRuntimeException: Problems while loading database driverclass (com.mysql.jdbc.Driver)”.

I found solution from here, downloaded mysql-connector-java-5.1.14.zip, unzipped, in Eclipse chose Project/Properties/JavaBuildPath/Libraries/AddExternalJars , and then chose mysql-connector-java-5.1.14-bin.jar

Now another error… Database in view “Hibernate Configurations” could not be expanded. Instead “Reading schema error: Getting database metadata” appeared.

Created new configuration… “Error while opening Database. The user must supply a JDBC connection” problem.

Did all steps again and carefully from the beginning according to mentioned tutorial, and suddenly I could expand database in Eclipse. Happiness.

Time to model my future application in more details…

 

No comments yet

Leave a comment