This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Configuring MYSQL Datasource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Configuring MYSQL Datasource" Watch "Configuring MYSQL Datasource" New topic

Configuring MYSQL Datasource

Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
i am trying to get a hold of mysql datasource and it throws a NameNotBoundException.
here is the code snippet which i am using

Hashtable default_properties = new Hashtable();
Context context = new InitialContext(default_properties);
DataSource ds = (DataSource) context.lookup("java:/MySqlDS");
java.sql.Connection con = ds.getConnection();

the following is the mysql-ds.xml file
and i also changed teh standardjaws.xml to
<type-mapping>Hypersonic SQL</type-mapping>-->
and also standardjbosscmp-jdbc.xml to
<datasource-mapping>Hypersonic SQL</datasource-mapping>-->
and copied the mysql-connector-java...jar file under lib folder
and also added an application policy for MsSqlDbRealm in login-config.xml
Could figure what else exactly i need to do.
the last thing i have to mentionis that i have a CMP which uses this datasource and it works but when i want to grab aconnection using this datasource it doesn't. i hope it is clear
I agree. Here's the link:
subject: Configuring MYSQL Datasource
It's not a secret anymore!