NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Configuring Mysql with Application server(Glass fish)

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
SreeAurovindh



Joined: 25 Jan 2009
Posts: 9

PostPosted: Sun Jan 25, 2009 7:29 pm    Post subject: Configuring Mysql with Application server(Glass fish) Reply with quote

I am quite a newbie to configure MySQL with application server.I have created a datasource pool but i am not aware of what to code in these tags.

In GUI of Netbeans under Services tab
I could see MySQL server at localhost:3306[root]

if i right click i could create a database.Suppose if i create a database named "gadgets" then what are the changes that i have to make in the above configuration in order to combine with my application server.

In this case what should be my JNDI lookup after creating a Context object


ds=(DataSource)ctx.lookup("A");
where ctx is Context object
and ds is DataSource object

what should be A in order to integrate with gadgets database.

From the tutorials i have copied some of the configuration contents.What are the contents that i have to change below?

------------------In deployment descriptor---------------------------
<resource-ref>
<res-ref-name>jdbc/leagueDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

----------------------in sun-web-app.xml---------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD
Application Server 8.1 Servlet 2.4//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">

<sun-web-app error-url="">
<context-root>/DVDLibraryLocalization</context-root>
<resource-ref>
<res-ref-name>jdbc/dvdLibraryDB</res-ref-name>
<jndi-name>jdbc/dvdLibraryDB</jndi-name>
</resource-ref>
<class-loader delegate="true"/>
<jsp-config>
<property name="classdebuginfo" value="true">
<description>Enable debug info compilation in the generated
servlet class</description>
</property>
<property name="mappedfile" value="true">
<description>Maintain a one-to-one correspondence between
static content and the generated servlet class' java
code</description>
</property>
</jsp-config>
</sun-web-app>

-------------------------------------------------------------------------------------


Thanks for your reply
Back to top
Victor M. Ramirez
Posted via mailing list.





PostPosted: Mon Jan 26, 2009 12:40 am    Post subject: Configuring Mysql with Application server(Glass fish) Reply with quote

try "jdbc/leagueDB" or "jdbc/dvdLibraryDB"

2009/1/25 SreeAurovindh <address-removed ([email]address-removed[/email])>
Quote:
I am quite a newbie to configure MySQL with application server.I have created a datasource pool but i am not aware of what to code in these tags.



In GUI of Netbeans under Services tab

I could see MySQL server at localhost:3306[root]



if i right click i could create a database.Suppose if i create a database named "gadgets" then what are the changes that i have to make in the above configuration in order to combine with my application server.



In this case what should be my JNDI lookup after creating a Context object





ds=(DataSource)ctx.lookup("A");

where ctx is Context object

and ds is DataSource object



what should be A in order to integrate with gadgets database.



From the tutorials i have copied some of the configuration contents.What are the contents that i have to change below?



------------------In deployment descriptor---------------------------

<resource-ref>

<res-ref-name>jdbc/leagueDB</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

<res-sharing-scope>Shareable</res-sharing-scope>

</resource-ref>



----------------------in sun-web-app.xml---------------------------------

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD

Application Server 8.1 Servlet 2.4//EN"

"http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">



<sun-web-app error-url="">

<context-root>/DVDLibraryLocalization</context-root>

<resource-ref>

<res-ref-name>jdbc/dvdLibraryDB</res-ref-name>

<jndi-name>jdbc/dvdLibraryDB</jndi-name>

</resource-ref>

<class-loader delegate="true"/>

<jsp-config>

<property name="classdebuginfo" value="true">

<description>Enable debug info compilation in the generated

servlet class</description>

</property>

<property name="mappedfile" value="true">

<description>Maintain a one-to-one correspondence between

static content and the generated servlet class' java

code</description>

</property>

</jsp-config>

</sun-web-app>



-------------------------------------------------------------------------------------





Thanks for your reply

------------------------
Sree Aurovindh

Sun Certified Java Programmer







--
Victor M. Ramirez A.
Ingeniero de Desarrollo
Alemsys S.A.



NOTA CONFIDENCIAL:

La información contenida en este e-mail es confidencial y sólo puede ser utilizada por la persona o la compañia a la cual está dirigido. Si usted no es el receptor autorizado, cualquier retención, difusión, distribución o copia de este mensaje es prohibida y sancionada por la ley. Si por error recibe este mensaje, favor devolver y borrar el mensaje recibido inmediatamente.

CONFIDENCIAL NOTE:

The information in this e-mail is intended to be confidential and only for the use of the person or entity to whom it is addressed. If you are not the intended recipient, any retention, dissemination, distribution or copying of this message is strictly prohibited and sanctioned by law. If you receive this e-mail by mistake, please immediately send back and delete the received message.
Back to top
SreeAurovindh



Joined: 25 Jan 2009
Posts: 9

PostPosted: Mon Jan 26, 2009 3:25 am    Post subject: Reply with quote

Thanks Victor M. Ramirez for your reply
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo