Wednesday, September 20, 2006

Setting up a MySQL Data Source for Sun Java Studio Creator

From : http://www.developer.com/db/article.php/10920_3514256_2

After installing MySQL, unpacking and copying the jar file, and creating a user and loading in some test data, it is time to actually use that data from Java Studio Creator.



  • First, start Java Creator Studio.

  • When it has loaded, from the top-left pane, right-click on Data Sources and choose Add Data Source.

  • A dialog will appear. For Server Type, select Add Server Type. Another dialog will appear.

  • Hit the New... button and navigate to the jar file you downloaded and copied earlier (called mysql-connector-java-3.1.8-bin.jar).

  • Next, set the display name to MySQL.

  • For the Driver Class Name, enter com.mysql.jdbc.Driver.

  • Finally, for the URL template, enter jdbc:mysql://#HOSTNAME:3306/#DATABASE.


Note: These same steps should be applied for any new JDBC-compliant database you want to use in Creator. There are already several defined (such as Oracle and DB2), so check those first, but if yours is not there, you can add it. You will obviously need different jar file settings, and will need to look up the Driver Class Name and the JDBC URL used in the documentation for the JDBC driver for that DB. Also, choose a name that describes the database.

Once you have finished entering the details here, click Close.


No comments: