Monday, December 21, 2009

Reminder of mysql and tomcat setup

For tomcat 6.0:
1. Keep the datbase db linker jar in the tomcat_installation_path\webapps\project_name\WEB-INF\lib. Do not move it to tomcat_installation_path\lib as it is shared by all applications on the server. Some threads also say keeping two copies of the db linker jar in the above folders may cause confliction(not verified yet)

2. Add context.xml to tomcat_installation_path\webapps\project_name\META-INF (pay attention here "META" not "WEB") for configuration of the application. The content of the file looks like:


<context>
<resource
name="jdbc/halal"
auth="Container"
type="javax.sql.DataSource"
maxactive="100"
maxidle="30"
maxwait="10000"
username="root"
password="root"
driverclassname="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/HaltrustApp?autoReconnect=true">
</resource>
</context>

For mysql 5.0:
1. Use "mysql server instance config wizard" for configuration after installation.
2. The database data path defined in my.ini will not be changed using 1 and may need modification by yourself (especially when mysql is not installed in default directory).
3. To import: source drive://folder1//folder2//xx.sql; (pay attention to //)

1 comment:

  1. if anyone interested to have a basic tutorial, you can chek this post:
    MySQL JDBC

    Regards

    ReplyDelete