Each database to which Cocoon connect has:
- a different site where you can download the appropriate jdbc drivers
- a different invocation of the class to load in web.xml file
- a different connection string
- some little differences you have to take into account
The instructions on how to set up a connection pool in general on a database can be found in the official documentation or in this good article .
Here is a table of the specificity that I and others have found, in connecting Cocoon to different databases:
Database |
|
|
|
[ |
com.mysql.jdbc.Driver |
jdbc:mysql://YourHostName:3306/YourDatabaseName?autoReconnect=true |
|
[ |
org.postgresql.Driver |
jdbc:postgresql://YourServerName:5432/DB_Name |
|
[ |
http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html] |
oracle.jdbc.driver.OracleDriver |
jdbc:oracle:thin:@YourServerName:1521:Instance_Name |
[ |
com.microsoft.jdbc.sqlserver.SQLServerDriver |
jdbc:microsoft:sqlserver://YourServerName:1433;DatabaseName=YourDatabaseName |
|
[ |
http://oss.software.ibm.com/developerworks/opensource/jt400/] |
com.ibm.as400.access.AS400JDBCDriver |
jdbc:as400://YourServerName |
com.opentext.basis.jdbc.BasisDriver |
jdbc:opentext:basis://dbUser:dbPassword@dbServer:2033/dbName |
Encoding tips
mySQL
If we want to use non-latin characters in mySQL, Greek for example, we need to have a more specific connection string:
jdbc:mysql://YourHostName:3360/YourDataBaseName?useUnicode=true&characterEncoding=YourEncoding
for example: (cocoon.xconf)
<jdbc name="pool_name"> <pool-controller min="5" max="10"/> <dburl>jdbc:mysql://YourHostName:3360/YourDataBaseName?useUnicode=true&characterEncoding=ISO-8859-7</dburl> <user>database_user</user> <password>database_password</password> </jdbc>