Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Configuring MYSQL Datasource

Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Bookmark Topic Watch Topic
  • New Topic