Bonjour tout le monde ;

j'utilise JBOSS 4.0.4 , et j'ia une application struts.

Je désire établir une connection avec une base de données MySql.j'ai utilisé le fihichier mysql-ds.xml, le voice aprés le paramètrage :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!-- $Id: mysql-ds.xml,v 1.3.2.3 2006/02/07 14:23:00 acoliver Exp $ -->
<!--  Datasource config for MySQL using 3.0.9 available from:
<a href="http://www.mysql.com/downloads/api-jdbc-stable.html" target="_blank">http://www.mysql.com/downloads/api-jdbc-stable.html</a>
-->
 
<datasources>
  <local-tx-datasource>
    <jndi-name>MySqlDS</jndi-name>
    <connection-url>jdbc:mysql://mysql-hostname:3306/worldbase</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name></user-name>
    <password></password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    <!-- should only be used on drivers after 3.22.1 with "ping" support
    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
    -->
    <!-- sql to call when connection is created
    <new-connection-sql>some arbitrary sql</new-connection-sql>
      -->
    <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
      -->
 
    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
    <metadata>
       <type-mapping>mySQL</type-mapping>
    </metadata>
  </local-tx-datasource>
</datasources>
Je met mon fichier dans le répértoire suivant : jboss-4.0.4.GA\server\default\deploy.

Je déploie mon application (j'ai pas ajouté le jar de mySql) et ça marche, est-ce normal?comment faire pour récupérer connection et faire les opération de (suppression , insertion....) dans mes actions struts.
Merci de m'indiquer comment faire et s'il y a d'autres config à ajouter.

par avance Merci.