users@glassfish.java.net

Re: MYSQL DataSource with Glassfish under Netbeans 6.9

From: <forums_at_java.net>
Date: Sun, 17 Apr 2011 21:07:15 -0500 (CDT)

*Hi Arun, *

*1)Where are you accessing this EntityManager ?*

I am Accessing this in* LoginForm.java *which extends JDialog. by the way I
cannot use dependency Injection like this :

*_at_PersistenceUnit EntityManagerFactory emf;*

Although I am using JDK 6

*2)with Mysql I have password and I can connect tothe datasource
:MYSQL/datasource  and the propertoes are correctly generated  in
sun-resources.xl  which is as follows:*

 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server
9.0 Resource Definitions //EN"
"http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
<resources>
    <jdbc-connection-pool allow-non-component-callers="false"
associate-with-thread="false" connection-creation-retry-attempts="0"
connection-creation-retry-interval-in-seconds="10"
connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0"
connection-validation-method="auto-commit"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
fail-all-connections="false" idle-timeout-in-seconds="300"
is-connection-validation-required="false"
is-isolation-level-guaranteed="true" lazy-connection-association="false"
lazy-connection-enlistment="false" match-connections="false"
max-connection-usage-count="0" max-pool-size="32"
max-wait-time-in-millis="60000" name="mysql_mysql_rootPool"
non-transactional-connections="false" pool-resize-quantity="2"
res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1"
steady-pool-size="8" validate-atmost-once-period-in-seconds="0"
wrap-jdbc-objects="false">
        <property name="serverName" value="localhost"/>
        <property name="portNumber" value="3306"/>
        <property name="databaseName" value="mysql"/>
        <property name="User" value="root"/>
        <property name="Password" value="miloud"/>
        <property name="URL"
value="jdbc:mysql://localhost:3306/mysql"/>
        <property name="driverClass" value="com.mysql.jdbc.Driver"/>
    </jdbc-connection-pool>
    <jdbc-resource enabled="true" jndi-name="mysql/datasource"
object-type="user" pool-name="mysql_mysql_rootPool"/>
</resources>
 

Many thanks


--
[Message sent by forum member 'Miloud_j2ee']
View Post: http://forums.java.net/node/789364