Lars

Assuming you're using the Microsoft 2000 JDBC driver,

1       Copy the three libraries from the unpacked distribution

msbase.jar
mssqlserver.jar
msutil.jar

to WEB-INF/lib

2       Add com.microsoft.jdbc.sqlserver.SQLServerDriver
to init-param in WEB-INF/web.xml, ending up with someting like ...

    <init-param>
      <param-name>load-class</param-name>
      <param-value>
        <!-- For MySQL Driver: -->
        <!-- org.gjt.mm.mysql.Driver replaced by -->
        com.mysql.jdbc.Driver

        <!-- For mssql2000 Driver: -->
        com.microsoft.jdbc.sqlserver.SQLServerDriver

        <!-- For parent ComponentManager sample:
        org.apache.cocoon.samples.parentcm.Configurator
        -->
      </param-value>
    </init-param>

3       Declare the datasource in cocoon.xconf, thus
                <jdbc name="mypool">
                        <pool-controller min="5" max="10"/>

<dburl>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb</dburl>
                        <user>myuser</user>
                        <password>mypassword</password>
                </jdbc>

By the way, as far as I can gather, you CAN'T use windows authentication
with the JDBC driver,
so you must set the server to use mixed security. That might cause your
sysadmin to flutter!

Now you can use mypool as a pooled connection name, e.g. in esql as
  <esql:pool>mypool</esql:pool>

As for what you can do with esql, that's another story !

Christopher

> -----Original Message-----
> From: Lars Martinsen [mailto:[EMAIL PROTECTED]]
> Sent: 09 September 2002 11:02
> To: '[EMAIL PROTECTED]'
> Subject: Connecting to MS SQL Server
>
>
> Does anyone have a step-by-step on how to connect to a MS SQL
> Server and do
> SQL commands on it? I have tried to do it by reading all the help and
> how-tos that is bundeled with Cocoon, but I didn't manage.
>
> .lars martinsen
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to