Email:   
Home
In This Issue
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.
Creating a MySQL data source using WebSphere Application Server (continued)

FIGURE I

Here's your new data source. Click picture for a larger image.

Add MySQL-specific custom properties to your data source entry
Click on the name of your new MySQL JDBC data source entry to return to the JDBC data source configuration screen. Scroll to the bottom of the screen as shown in Figure J and click on the Custom Properties link in the Additional Properties section.

FIGURE J

Get ready to configure some custom properties. Click picture for a larger image.

This should take you to the empty Custom Properties list, shown in Figure K, where you can begin entering the six custom properties necessary to complete your MySQL Data Source entry.

FIGURE K

Now you can configure some hidden, but very important options. Click picture for a larger image.

The six custom properties, which are another difficult to locate tidbit of critical information, and their respective values are:

Name Type Value
databaseName java.lang.String <database-name>?autoReconnect=true
factory java.lang.String com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory
password java.lang.String <password>
port java.lang.String 3306 (or your MySQL port, if you have changed it)
serverName java.lang.String <server=name>
user java.lang.String <user-name>

Custom properties are entered one property at a time using the Custom Property Configuration screen. To enter your first property, click on the New button above the empty property list, which should take you to the Custom Property Configuration screen illustrated in Figure L.

FIGURE L

Enter the property name, Java type, and property value, then click OK Click picture for a larger image.

Enter the property name, Java type, and property value, then click OK. Repeat this process for all six of the properties listed above.

When you have completed entering all of the custom properties, the last step is to save all of the changes that you have made to the master configuration. After successfully entering the data for the last custom property, you should still be on the list of custom properties for your new data source, as shown in Figure M.

FIGURE M

Here you can see all your custom properties Click picture for a larger image.

At the top of the screen, you should still see the message about saving your changes to Master Configuration. Clicking on the word Save in that message will take you to the Save to the Master Configuration screen shown in Figure N.

FIGURE N

Don't forget to save your configuration. Click picture for a larger image.

Click on the Save button to save your newly completed MySQL JDBC data source configuration and you are ready to start using your new data source.

Wrap-up
By following these three simple steps, you can create your first MySQL JDBC data source. If you need additional MySQL data sources in the same server instance, creating the rest is even easier. Step one, creating the MySQL JDBC Provider only has to be done once per server; additional data sources can be added using the same provider by just completing steps two and three. Just make sure that your .jar file for the MySQL JDBC driver is accessible to the server and your new data source should be ready to go.

Product availability and resources
To read Easily connecting to MySQL databases from WebSphere Studio, visit http://www.webspherepower.com/issues/issue200310/00001111001.html.
Jeff Chilton is a Contributing Editor for DominoPower and WebSpherePower magazines, and in his spare time serves as Vice President of Fulfillment for Echo Technology Group, Inc., an IT consulting firm that specializes in enterprise-focused best practices. Visit http://www.teametg.com for more information or email him at jchilton@teametg.com.




[ Prev ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

Sun Virtualization offerings for IBM WebSphere infrastructures
Increase the value of your enterprise IT environment through server consolidation

  • Reduced costs lead to improved TCO
  • Optimized application performance
  • Added flexibility
  • Enhanced service levels


Watch the webcast to learn more
Copyright © 2008, ZATZ Publishing. All rights reserved worldwide.