Results 1 to 4 of 4

Thread: Datasource

  1. #1
    samson is offline Member
    Join Date
    Mar 2007
    Posts
    16
    Rep Power
    0

    Default 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

  2. #2
    ferosh is offline Member
    Join Date
    Mar 2007
    Posts
    11
    Rep Power
    0

    Default

    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>

  3. #3
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Posts
    134
    Rep Power
    0

    Default

    Please put code in this format '[ code ] int temo = 0;[ / code]
    Java 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>

  4. #4
    ferosh is offline Member
    Join Date
    Mar 2007
    Posts
    11
    Rep Power
    0

    Default

    '[ 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]'

Similar Threads

  1. Unable to get a XAConnection from the DataSource.
    By Eric in forum Enterprise JavaBeans (EJB)
    Replies: 3
    Last Post: 05-16-2008, 11:17 AM
  2. Datasource starts after web application
    By anosh_nathaniel in forum XML
    Replies: 0
    Last Post: 12-12-2007, 10:49 AM
  3. Datasource starts after web application
    By anosh_nathaniel in forum XML
    Replies: 0
    Last Post: 12-12-2007, 10:47 AM
  4. Cannot set DataSource for RowSet
    By piterskiy in forum JDBC
    Replies: 0
    Last Post: 12-07-2007, 07:58 PM
  5. Replies: 1
    Last Post: 06-06-2007, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •