Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-02-2007, 08:56 AM
Member
 
Join Date: Mar 2007
Posts: 16
samson is on a distinguished road
Datasource
Can Anybody give me the xml for connecting JSP with mysql database.I want to make use of JNDI connection in jsp.
Thanks in advance
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-02-2007, 10:01 AM
Member
 
Join Date: Mar 2007
Posts: 13
ferosh is on a distinguished road
U have to add an xml file in jboss\server\default\deploy...

Then u have to make a servlet context from jsp or from servlet..
The format is given below

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

<datasources>
<local-tx-datasource>
<jndi-name>mysqlDs</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/mytest</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>put your username hre </user-name>
<password>put your password hre</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>50</max-pool-size>
<idle-timeout-minutes>30</idle-timeout-minutes> <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysq lExceptionSorter</exception-sorter-class-name> <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidCo nnectionChecker</valid-connection-checker-class-name>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-02-2007, 11:44 AM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
Please put code in this format '[ code ] int temo = 0;[ / code]
Code:
<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>mysqlDs</jndi-name> <connection-url>jdbc:mysql://localhost:3306/mytest</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>put your username hre </user-name> <password>put your password hre</password> <min-pool-size>5</min-pool-size> <max-pool-size>50</max-pool-size> <idle-timeout-minutes>30</idle-timeout-minutes> <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysq lExceptionSorter</exception-sorter-class-name> <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidCo nnectionChecker</valid-connection-checker-class-name> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-02-2007, 12:06 PM
Member
 
Join Date: Mar 2007
Posts: 13
ferosh is on a distinguished road
'[ code ]

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

<datasources>
<local-tx-datasource>
<jndi-name>mysqlDs</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/mytest</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>put your username hre </user-name>
<password>put your password hre</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>50</max-pool-size>
<idle-timeout-minutes>30</idle-timeout-minutes> <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysq lExceptionSorter</exception-sorter-class-name> <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidCo nnectionChecker</valid-connection-checker-class-name>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>




[ / code]'
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error, org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy Felissa JavaServer Faces 2 06-26-2008 10:20 PM
Unable to get a XAConnection from the DataSource. Eric Enterprise JavaBeans 3 05-16-2008 12:17 PM
Datasource starts after web application anosh_nathaniel XML 0 12-12-2007 11:49 AM
Datasource starts after web application anosh_nathaniel XML 0 12-12-2007 11:47 AM
Cannot set DataSource for RowSet piterskiy Database 0 12-07-2007 08:58 PM


All times are GMT +3. The time now is 07:26 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org