Hi,

I've been trying to get MySQL working in my Struts app with NetBeans 5.5 and 
Sun Java System Application Server 9. I think I'm almost there, because 
NetBeans can succsesfully connect to MySQL, but my app can't. I read tons of 
posts in the mailing list archive but I couldn't solve the problem.
Please take a look at what I'd done so far:

- MySQL 5 is downloaded and installed
- MySQL Driver (MySQL Connector/J) was downloaded 
(mysql-connector-java-5.0.5-bin.jar) and copied to the application server's lib 
directory (for me it's C:\Sun\SDK\lib\)
- the following lines are present in my struts-config.xml file:

<data-source type="org.apache.commons.dbcp.BasicDataSource" key="dbSource">
            <set-property property="driverClassName" 
value="com.mysql.jdbc.Driver" />
            <set-property property="url" 
value="jdbc:mysql://localhost:3306/employees" />
            <set-property property="username" value="root"/>
            <set-property property="password" value="cwp309"/>
            <set-property property="validationQuery" value="SELECT * FROM 
CUSTOMER" />
</data-source>

Each time I deploy and launch my app, I get an error: "HTTP Status 404 - 
Servlet action is not available".
The interesting part is that if I try to connect to the built-in "derby" 
datasource, the error message won't come up.
What am I missing?
The other thing I don't understand is why do I need to specify a database name 
in the
<set-property property="url" value="jdbc:mysql://localhost:3306/employees" />
line of the datasource tag? Does it mean that one data-source tag can connect 
to one database? So if I have let's say 5 databases, do I need to have 5 
data-source tags in my struts-config.xml?

Thanks for your replies.

Regards,

  Michnay


 
____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 

Reply via email to