Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > FAQs > How do I connect Tomcat to the master MySQL database?

How do I connect Tomcat to the master MySQL database?

Background Information

You need to know how to connect your Apache Tomcat application to the Master MySQL database.

 


Answer

The RightScripts handle this automatically but to resolve the JNDI link 'java:comp/env/jdbc/MYSQLDB', you must do the following:

  • Allow RightScale's server.xml to host primary jdbc connection
  • Add "ResourceLink" element to META-INF/context.xml.  See the following example:
<?xml version=*"1.0"* encoding=*"UTF-8"*?>
<Context>
          <ResourceLink name=*"jdbc/MYSQLDB"* global=*"jdbc/MYSQLDB"* type=*"javax.sql.Datasource"* />
</Context>
  • In web.xml, add the following resource ref:
    • DB Connection
    • jdbc/MYSQLDB
    • javax.sql.DataSource
    • Container

See also

Viewing 1 of 1 comments: view all
Edited
Posted 15:53, 25 Oct 2013
Viewing 1 of 1 comments: view all
You must to post a comment.
Last modified
13:24, 10 Mar 2014

Tags

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.