Hello Petter,

<web-app>
  <!-- JSTL database -->
  <context-param>
    <param-name>
      javax.servlet.jsp.jstl.sql.dataSource
    </param-name>
    <param-value>
        
jdbc:mysql://localhost/testDB,com.mysql.jdbc.Driver,USERNAME,PASSWORD
    </param-value>
  </context-param>
</web-app>

replacing USERNAME and PASSWORD with appropriate values. Then, in your
JSP code,
There will be no need to specifiy the data source.

Normand McGuire
------------------------------------------------------------------------
--------


From: Petter Karlström 
Subject: default DataSource for mySQL? 
Date: Mon, 13 Jan 2003 00:33:50 -0800 

Hi all,

I'm accessing a mySQL database via JSTL:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core";; %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql";; %>

<sql:setDataSource var="example" scope="application"
   driver="com.mysql.jdbc.Driver"
   url="jdbc:mysql://localhost/testDB"
   user="****"
   password="****"
/>
...

This works fine. However, I fail to find correct info on how to set
this DataSource to be the default one in server.xml (or by Tomcat's
web interface). I'm running Tomcat 4.1.12 and mySQL 3.23.51 How to
set the database in web.xml would be helpful as well.

thanks

Petter Karlström


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

Reply via email to