On 10/28/2008 05:00 PM, hussayn wrote:
Hi, mark; thanks fo your response.
To answer your question: I want to use the MySQL drivers for development,
but the final production application shall run with MS sqlserver.
So from your remark what shall i conclude ?
I have to add a class loader of my own ?
no, probably not. cocoon will provide one ...
hmm. just place the driver anywhere into my own block ?
Shall i create a lib submenu under
src/main/resources/WEB-INF/lib
right within my block sources ? And maven would sort out where to put it
and cocoon will grab from where maven has put it ?
That would make sense to me ...
But probably the truth is different ;-)
So which options do i have ?
You should let Maven handle the dependencies. If you declare the driver
JARs as dependencies in your pom.xml Maven will handle putting them in
the classpath transparently.
For MySQL this is dirt simple since the drivers are deployed in the
central Maven repository; just add it to your pom.xml like:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
For the MS sqlserver, I don't know if that JAR is available in a public
repository, I would guess not due to distribution restrictions. In that
case you may have to manually install the JAR into your local repository
first. To do that you'd add a dependency something like:
<dependency>
<groupId>com.microsoft</groupId>
<artifactId>sqlserver-driver</artifactId>
<version>12345</version>
</dependency>
(The names and version you use are really arbitrary so long as they
match what you use in the next step.)
And then install the JAR file in your local repository; see
http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html and
http://maven.apache.org/plugins/maven-install-plugin/usage.html
Hope that helps
--Jason
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]