struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chuanjiang lo" <lochuanji...@gmail.com>
Subject Re: what's wrong?? ---Connection with MySQL database
Date Tue, 14 Mar 2006 14:11:01 GMT
did you include the mysql jdbc jar in your classpath?

On 3/14/06, Zheng Wen Zhe <zwenzhe@espatial.com> wrote:
>
> Hi,
>
> Why I got this error when initialize web server????
>
>
>
> ERROR <14-Mar-2006 13:52:17> Initializing application data source userDB
>
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> class '' for connect URL 'jdbc:mysql://localhost:3306/struts'
>
>
>
> *************************************************************************
>
> Struts-config.xml file:
>
> <data-source type="org.apache.commons.dbcp.BasicDataSource" key="userDB">
>
> <set-property property="maxCount" value="4" />
>
> <set-property property="minCount" value="2" />
>
> <set-property property="description"
>
> value="Artimus:MySQL Data Source Configuration" />
>
> <set-property property="driverClass" value="com.mysql.jdbc.Driver" />
>
> <set-property property="url" value="jdbc:mysql://localhost:3306/struts" />
>
> <set-property property="autoCommit" value="true" />
>
> <set-property property="user" value="root" />
>
> <set-property property="password" value="password" />
>
> </data-source>
>
>
>
> Retrieve data in jsp file:
>
> <sql:query var="rs" dataSource="userDB">
>
> select id, foo, bar from testdata
>
> </sql:query>
>
>
>
> Regards,
>
>
>
> Jason
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message