Connecting to MySQL from Java

I would like to highlight how to establish a connection between MySQL a database and your JAVA app.

I assume you have installed MySQL and Java .

You must download the Mysql Connector/J 3.1 from mysql.com .

I downloaded the file mysql-connector-java-3.1.13.tar.gz and used the file

mysql-connector-java-3.1.13-bin.jar

Now in the Java class where want to connect to the MySQL database , addthe following code
[code lang=”java”]

Class.forName(“com.mysql.jdbc.Driver”) ;

Connection Con = DriverManager.getConnection(“jdbc:mysql://localhost:3306/

database_name”,”user”,”pass”);

[/code]

Now you can use the Con object to carry out the queries.

Sony Ericsson joins Eclipse as Add-in Provider Member

On August 29, 2006 Sony Ericsson announced that it is joining the Eclipse community as Add-in Provider Member. By becoming an Add-in Provider, Sony Ericsson aims to contribute to the Eclipse ecosystem through creating Eclipse plug-ins of benefit to the global mobile application developer community.

Eclipse is an open-source community bringing together a number of leading organizations to create the Eclipse Platform. The platform is designed for building applications, integrated development environments (IDEs) and various tools.

Continue reading Sony Ericsson joins Eclipse as Add-in Provider Member

Back to MySQL command line after a long time

Its been a long while since i have actually used the mysql command line client..

Thanks to phpmyadmin which i have been using for the past 2 years.

phpMyadmin does many things without troubling me.

I had a problem renaming a database and I found out that mysql does not have rename database statement until MySQL 5.1.7.

so what to do ?

mysqldump came to the rescue as usual. I had to generate a dump of the current database.

Then create a new database with the desired name, and then import back the dump into the

new database , and then drop the old database.