Overblog
Editer l'article Suivre ce blog Administration + Créer mon blog
29 mai 2010 6 29 /05 /mai /2010 14:35

derby-logo-web.png

 

Voici un exemple de déclaration d'un datasource minimaliste pour une database Derby sous JBoss 4.

 

Pour déclarer un datasource derby, il faut :

- Copier dans le repertoire lib de l'instance Jboss la libraire derbyClient.jar, par exemple dans server\default\lib

- Déclarer un fichier derby-ds.xml dans le repertoire de déploiment, par exemple dans server\default\deploy

 

et c'est fini. :)

 

Voici le fichier derby-ds.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
 
<datasources>
    <local-tx-datasource>
        <jndi-name>MyDb</jndi-name>
        <connection-url>jdbc:derby://localhost:1527/myLittleDb;create=true</connection-url>
        <driver-class>org.apache.derby.jdbc.ClientDriver</driver-class>
        <user-name>admin</user-name>
        <password>admin</password>
        <min-pool-size>5</min-pool-size>
        <max-pool-size>20</max-pool-size>
        <idle-timeout-minutes>5</idle-timeout-minutes>
        <track-statements/>
    </local-tx-datasource>
</datasources>

 

 

Référence : http://community.jboss.org/wiki/SetUpADerbyDatasource

Le client derby : http://repo1.maven.org/maven2/org/apache/derby/derbyclient

Testé avec : Java 5, Jboss 4.2.3 et derby 10.5.3.0_1

 

 

Partager cet article
Repost0

commentaires

Summary

  • : GetJ2ee -Java development
  • : Articles about Java and EE
  • Contact

Profil

  • David Gimelle
  • Java Developer for more 10 years. I worked in France, Canada and Switzerland. I am contractor in London since 2010.
  • Java Developer for more 10 years. I worked in France, Canada and Switzerland. I am contractor in London since 2010.

Contact

You can contact me here

or by Twitter

Search

Archives