Haa....Thanks for all reply. It seems goooooogle is every thing.

-----Original Message-----
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: 14 March 2006 14:24
To: Struts Users Mailing List
Subject: Re: what's wrong?? ---Connection with MySQL database

Zheng Wen Zhe wrote:
> Why I got this error when initialize web server???? 
>   

Well, let's take a look:

> 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'
>   

It looks like the machine thinks you haven't defined a class for the
database driver.

Why could that be?

> <data-source type="org.apache.commons.dbcp.BasicDataSource" key="userDB">
> <set-property property="driverClass" value="com.mysql.jdbc.Driver" />
>   

Hmm.

I'll bet _you_ thought you defined one.

I wonder what google says:

http://www.google.com/search?q=struts+%2Bdatasource

Looking at two of the returned hits:
http://struts.apache.org/struts-doc-1.2.x/faqs/database.html
http://www.roseindia.net/struts/strutsdatasourcemanagerontomcat5.shtml

Both seem to indicate that you actually want:

    <set-property
      property="driverClassName"
      value="com.mysql.jdbc.Driver" />

See the difference? Try this and see if that fixes the problem.

Total time spent (not including typing this email): about 1 minute, 45
seconds.
Time spent typing the email: 2 minutes.
Time you'll wait to read a response on the newsgroup: 5-15 minutes.
Ability to debug your own app: priceless.

Google is your friend.

Dave



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

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

Reply via email to