How to run jdonframework's demo sample?

Download source SimpleJdonFrameworkTest.rar

安装运行步骤:

1. 确保已经安装J2SE 1.5 以上版本,然后设置操作系统的环境变量 JAVA_HOME=你的J2SE目录

2. 下载Tomcat/JBoss 、Websphere和Weblogic类似JBoss操作。

3. 启动数据库MYSQL,将database.sql导入到数据库中。

4.如果你使用JBoss,配置JBOSS与MySQL的数据源
安装JBoss服务器对数据库的连接设置:JBOss按下面步骤:假设你使用MySQL
1.copy lib/jeelib/mysql-connector-java-3.0.14-production-bin.jar to jboss/server/default/lib, and restart jboss
2.copy mysql-ds.xml to jboss/server/default/deploy, if need delete hsqldb-ds.xml。
open mysql-ds.xml to edit:
<datasources>
<local-tx-datasource>
<jndi-name>TestDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=UTF-8</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password></password>
</local-tx-datasource>
</datasources>
if your mysql database's root password changed ,change the <password> value
note: the jndi name must be TestDS, it has configured in application.

jndi-name为TestDS,WEB-INF/jboss-web.xml已经配置java:/TestDS(缺省无需修改)
在JNDI名称前加java:/是JBoss服务器的规定.
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/TestDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/TestDS</jndi-name>
</resource-ref>
</jboss-web>

4. 如果使用Tomcat 配置Tomcat与MySQL的数据源
(1).copy lib/jeelib/mysql-connector-java-3.0.14-production-bin.jar to tomcat/lib or tomcat/commons/lib
(2).在tomcat6的conf目录下的context.xml(tomcat 5.5以上版本存在这个文件)加入
<Resource name="jdbc/TestDS"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="root"
password=""
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/test" />

username="root" is youre database's user name
password="" is user name's password

如果没有发现context.xml,就在server.xml的<Host></Host>中中加入:
<Context path="/testWeb" debug="1" reloadable="true" crossContext="true">
Resource name="jdbc/TestDS"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="root"
password=""
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/test" />
</Conext>

6. startup jboss/bin/startup.bat or tomat/bin/startup.bat
check the console, if there are many errors, open jboss/server/default/log/server.log
and will find it maybe caused by database connection, carefully check step 7/8

7. copy dist/testWeb.war to tomcat/webapps or jboss/server/default/deploy
open browser, http://localhost:8080/testWeb/
same DEMO in Internet: /testWeb/