users@glassfish.java.net

Re: Creating a JNDI for MySQL ?

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Thu, 18 Oct 2007 19:32:52 +0530

Please look at http://blogs.sun.com/JagadishPrasath/date/20070614 for similar
templates in GlassFish

Thanks
--Siva.



glassfish_at_javadesktop.org wrote:
> Hello,
>
> Not that used to Glassfish, coming from JBoss 4.2.1.
> Creating a EJB 3.0 application, wanting to check out the WebService utility.
> Having problem creating a JNDI from the admin interface in Glassfish.
>
> Creating a JNDI is very easy using JBoss, you find your mysql-ds.xml file
> in the '~/example/jca'-folder and you edit it to fit your need.
> <?xml version="1.0" encoding="UTF-8"?>
>
> <datasources>
> <local-tx-datasource>
> <jndi-name>company</jndi-name>
> <connection-url>jdbc:mysql://localhost:3306/companydb</connection-url>
> <driver-class>com.mysql.jdbc.Driver</driver-class>
> <user-name>root</user-name>
> <password>root</password>
> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
> <metadata>
> <type-mapping>mySQL</type-mapping>
> </metadata>
> </local-tx-datasource>
> </datasources>
>
> And everything works just fine, you create your persistence.xml in your application and you make the match between the unit-name and the JNDI-name above given ( company ). Evertything works.
>
> Glassfish:
> From within the admin-interface I choose
> -resources
> - - jndi
> - - - external resource
> And I am stuck seeing the below variables that I have to fill out:
> JNDI Name: Required
> Resource Type: Required
> Factory Class: Required
> JNDI Lookup: Required
> Status:
>
> Could anyone give me a hand here, so that I can access my MySQL - companydb ?
>
> regards, i
> [Message sent by forum member 'inkimar' (inkimar)]
>
> http://forums.java.net/jive/thread.jspa?messageID=240904
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>