bonjour a tous, je travail sur une application (JEE:jsf), avec une base de données MYSQL, le deploiment sur le serveur web TOMCAT, j'ai une table qui est tres volumineuse, du coup mon chef ma demandé de cree une nouvelle connection vers un sgbd nosql, le mongodb,
bon j'ai telechargé le driver java mongo, que j'ai mis dans le fichier lib de l'application et dans le fichier lib de tomcat, et j'ai configuré le fichier context.xml de tomcat
VOILA POUR LA CONFIGURATION DE MYSQL QUI FONCTIONNE
VOILA POUR LA CONFIGURATION DE MONGODB
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" logAbandoned="true" maxActive="20" maxIdle="5" maxWait="-1" name="jdbc/mabase_db" removeAbandoned="true" removeAbandonedTimeout="300" type="javax.sql.DataSource" url="jdbc:mysql://127.0.0.1/mabase" username="root"/> <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="1" maxOpenPreparedStatements="5" maxWait="-1" name="jdbc/cls" password="adminDS" poolPreparedStatements="true" removeAbandoned="true" removeAbandonedTimeout="300" type="javax.sql.DataSource" url="jdbc:mysql://127.0.0.1/cls" username="adminDS"/>
MAIS CA MARCHE PAS
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <Resource name="testMongodbDS" driverclassName="com.mongo.jdbc.driver" auth="Container" type="com.mongodb.DB" factory="org.mongodb.datasource.MongoDatasourceFactory" host="localhost" port="27017" databaseName="jdbc/db" username="" password="" minPoolSize="10" maxPoolSize="100" maxWaitTime="10000"/>
Partager