1. Get the latest MySQL JDBC Connector/J driver from www.mysql.com - 3.0.11 works well. Place the JAR driver file in your jboss/server/default/lib directory.
2. Create a file called mysql-ds.xml (or anything-ds.xml) with the following contents, and drop it in the deploy directory:
<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>MysqlDS</jndi-name> <connection-url>jdbc:mysql://localhost/test</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>yourusername</user-name> <password>yourpassword</password> </local-tx-datasource> </datasources>
Of course, replace 'yourusername' and 'yourpassword' with a username and password that can access the database.
As for getting an app to talk to the DB, I recommend the jboss workbook that goes with o'reilly's EJB book, see http://www.oreilly.com/catalog/entjbeans3/workbooks/
Thanks for teh help. I'll try it.
Will JSTL work in jboss, where do I put the jstl.jar file?
I managed to get my jsp talking to mysql in jboss 4.0RC3
I cannot get jboss 3.2.3 working.
Does anyone know why the 4.0 works and not the 3.2.3?
Can I unse 4.0 in production?
What are you trying to do in JSP? What is the error message you get from JBoss 3.2.3?
JBoss 3.2.3 defaults to Tomcat 4.1, not 5.0. You may need 5.0 to use parts of the JSTL. You can install Tomcat 5.0 in Jboss 3.2.3 by running the ant script in the jboss\docs\examples\tomcat directory. Also Jboss 3.2.4RC1 defaults to Tomcat 5 and I've used JSTL with it.
Here is the message:
org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jsp/jstl/sql) cannot be resolved in either web.xml or the jar files deployed with this application
Here is the jsp file contents
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Thanks for the help.
I replaced the tomcat 4.1 server with the 5.0 version.
I get this error message now using the test.jsp file above