第一個(gè)項(xiàng)目都要寫 build.xml 一些基本的東西先寫好
<?xml version="1.0" encoding="UTF-8"?>
<project name="jsp-svn" default="init">
<property file="build.properties" />
<property name="src.java.dir" value="src" />
<property name="src.test.dir" value="test" />
<property name="build.java.dir" value="build/classes/java" />
<property name="build.test.dir" value="build/classes/test" />
<property name="build.classes.dir" value="build/classes" />
<property name="test.docxml.dir" value="doc/test/xml" />
<property name="test.reports.dir" value="doc/test/reports" />
<property name="web.root" value="WebContent" />
<!-- 定義類路徑 -->
<path id="project.classpath">
<fileset dir="${web.root}/WEB-INF/lib">
<include name="*.jar" />
</fileset>
<pathelement location="${build.java.dir}" />
<pathelement location="${build.test.dir}" />
<pathelement location="${junit.jar}" />
</path>
<target name="init">
<mkdir dir="${build.java.dir}" />
<mkdir dir="${build.test.dir}" />
</target>
<target name="compile.java" depends="init">
<mkdir dir="${build.java.dir}" />
<javac destdir="${build.java.dir}">
<src path="${src.java.dir}" />
<classpath refid="project.classpath">
</classpath>
</javac>
</target>
<target name="compile.test" depends="compile.java">
<mkdir dir="${build.test.dir}" />
<javac destdir="${build.test.dir}">
<src path="${src.test.dir}" />
<classpath refid="project.classpath" />
</javac>
</target>
<target name="compile" depends="compile.java,compile.test">
</target>
<target name="build.java" depends="compile.java">
<copy todir="${build.java.dir}" preservelastmodified="true">
<fileset dir="${src.java.dir}">
<include name="**/*.*" />
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="build.test" depends="compile.test">
</target>
<target name="build" depends="build.java,build.test" />
<target name="deploy" depends="build.java">
</target>
<target name="test" depends="build">
<mkdir dir="${test.docxml.dir}" />
<mkdir dir="${test.reports.dir}" />
<junit haltonfailure="yes" fork="yes">
<formatter type="plain" usefile="false" />
<formatter type="xml" />
<test name="example.ExampleTest" todir="${test.docxml.dir}">
</test>
<classpath refid="project.classpath" />
</junit>
<junitreport todir="${test.docxml.dir}">
<fileset dir="${test.docxml.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${test.reports.dir}" />
</junitreport>
</target>
<target name="schema" depends="build.java">
<taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask">
<classpath refid="project.classpath" />
</taskdef>
<schemaexport config="${build.java.dir}/hibernate.cfg.xml"
quiet="no" text="true" drop="no" delimiter=";"
output="${build.classes.dir}/${project.name}_db.sql" />
</target>
<target name="clean">
<delete includeEmptyDirs="true">
<fileset dir="${build.classes.dir}">
<include name="**/*.class" />
</fileset>
</delete>
</target>
</project>
build.properties
junit.jar=${eclipse.home}/plugins/org.junit_3.8.1/junit.jar
posted @
2007-05-05 14:32 流浪汗 閱讀(402) |
評論 (0) |
編輯 收藏
開發(fā)時(shí)大多數(shù)就是只想運(yùn)行新增加的測試
雖然可以寫個(gè)main方法
public static void main(String[] args) {
junit.framework.Test t = new ExampleTest("testMethod");
TestRunner.run(t);
}
但這樣很不方便, 每想測試一個(gè)方法都要改.
Eclipse 這個(gè)方便的工具, 應(yīng)該有單獨(dú)運(yùn)行一個(gè)Junit 的test的方法的.
然后在
http://www.javaeye.com/post/78284 的8樓找到了, 多謝 :)
Outline(大綱) 右擊一個(gè)方法 Run As... -> Junit test就OK了
哈哈
posted @
2007-05-05 13:04 流浪汗 閱讀(669) |
評論 (0) |
編輯 收藏
今天初了下 hsqldb
下載 hsqldb
http://sourceforge.net/project/showfiles.php?group_id=23316下載 hsqldb_1_8_0_7.zip
解壓到 D:/hsqldb
在 D:/hsqldb 目錄下創(chuàng)建 runxdb.bat 文件如下:
cd data
java -cp ../lib/hsqldb.jar org.hsqldb.Server -database.0 xdb -dbname.0 xdb
然后雙擊 runxdb.bat 啟動(dòng) hsqldb Server
到目錄 demo 下運(yùn)行 runManagerSwing.bat 來創(chuàng)建表
type : HSQL Database Engine Server
url : jdbc:hsqldb:hsql://localhost/xdb
user : SA
建表:
CREATE MEMORY TABLE TEXT(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,NAME VARCHAR);
添加數(shù)據(jù):
INSERT INTO TEXT VALUES(1,'chenlb')
INSERT INTO TEXT VALUES(2,'Tenny')
Java 文件
package hsqldb;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* @author chenlb 2007-4-28
*
*/
public class HsqldbFirstSimple {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Class.forName("org.hsqldb.jdbcDriver" );
} catch (Exception e) {
System.out.println("ERROR: failed to load HSQLDB JDBC driver.");
e.printStackTrace();
return;
}
try {
Connection c = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/xdb", "sa", "");
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("select * from text");
while(rs.next()) {
System.out.println(rs.getString(1)+"\t"+rs.getString(2));
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
posted @
2007-04-28 15:31 流浪汗 閱讀(2467) |
評論 (0) |
編輯 收藏
MySQL 5.1參考手冊(中文mysql.cn)
http://doc.mysql.cn/mysql5/refman-5.1-zh.html-chapter/官方
http://dev.mysql.com/doc/refman/5.1/zh/index.html
posted @
2007-04-27 19:25 流浪汗 閱讀(356) |
評論 (0) |
編輯 收藏
WMP10 老是彈出更新, 昨日就點(diǎn)了更新
下載后,出現(xiàn)驗(yàn)證,驗(yàn)證當(dāng)然通不過啦。
驗(yàn)證不過,想回到10,但回不到10
重裝10出現(xiàn)下面情況

用優(yōu)化大師刪除解決不了,安全模式下刪除所有相關(guān)的,注冊表里刪除所有MediaPlayer了,郁悶還是不行。
然后找到了一些破解方法其中下面是
不行的 (只是我這不行)
如果沒有運(yùn)行過WMP11可以用這個(gè)方法(可能行)。
一、準(zhǔn)備壓縮解壓軟件winrar ,一般電腦上都有!沒有的這下載最新版的http://www.xkyn.com/Soft/soft/rar/Soft_6.htm
二、不要直接雙擊下載的windows media player 11的安裝文件,而在這個(gè)文件上點(diǎn)鼠標(biāo)右鍵,選“解壓到‘wmp11-windowsxp-x86-zh-cn’”,或者選“用winrar打開”,總之,用winrar解壓這個(gè)文件。
三、解壓的文件:
可以看到許多的文件,其中有四個(gè)EXE擴(kuò)展名結(jié)尾的可執(zhí)行文件。
我們依次運(yùn)行這四個(gè)文件就可以安裝windows media player 11 了。注意運(yùn)行這個(gè)四個(gè)文件的順序是:
1.umdf.exe
2.wmdbexport.exe
3.wmfdist11.exe
4.wmp11.exe
都執(zhí)行了以后,馬上去打開你的windows media player吧 系統(tǒng)會(huì)自動(dòng)對數(shù)據(jù)庫進(jìn)行升級,然后就可以看到華麗的界面
原因:是有更新下載WMP11(推測系統(tǒng)有記錄),出錯(cuò)如下:

當(dāng)我做這個(gè)方法的所有步驟時(shí),還是會(huì)出現(xiàn)驗(yàn)證。這時(shí)很火了,決定今天一定破解它。
然后找到
美好人生 的BLOG
http://hi.baidu.com/cxg770624/blog/item/1133fe0918c7cf83d1581be2.html
1、 安裝windows media player11,點(diǎn)擊驗(yàn)證,通不過,點(diǎn)擊完成;
2、再次安裝windows media player11,先不要急著點(diǎn)擊驗(yàn)證,切記切記!
3、打開C:\Documents and Settings\All Users\Application Data\ (復(fù)制到地址欄) 刪除Windows Genuine Advantage這個(gè)文件夾,然后斷開網(wǎng)絡(luò),在網(wǎng)上鄰居上禁用本地連接,如果你找不到干脆拔掉網(wǎng)線好了:)
5. 點(diǎn)擊驗(yàn)證。
OK,終于勝利安裝了!
用這個(gè)方法解決了。
感謝
美好人生 。
:)
轉(zhuǎn)載:
美好人生沒辦法于是到網(wǎng)上搜索Windows Media Player 11簡體中文版無法通過驗(yàn)證安裝的解決方案,一會(huì)功夫終于用這個(gè)方法解決了:)
1、 安裝windows media player11,點(diǎn)擊驗(yàn)證,通不過,點(diǎn)擊完成;
2、再次安裝windows media player11,先不要急著點(diǎn)擊驗(yàn)證,切記切記!
3、打開C:\Documents and Settings\All Users\Application Data\ (復(fù)制到地址欄) 刪除Windows Genuine Advantage這個(gè)文件夾,然后斷開網(wǎng)絡(luò),在網(wǎng)上鄰居上禁用本地連接,如果你找不到干脆拔掉網(wǎng)線好了:)
5. 點(diǎn)擊驗(yàn)證。
OK,終于勝利安裝了!
方法一:
安裝不要點(diǎn)驗(yàn)證,搜索C:\Documents and Settings\All Users\Application Data\Windows Genuine Advantage\data
把data文件刪除掉,斷開網(wǎng)絡(luò),這個(gè)時(shí)候點(diǎn)驗(yàn)證,就可以通過啦。
祝你安裝成功!
方法三:
一、準(zhǔn)備壓縮解壓軟件winrar ,一般電腦上都有!沒有的這下載最新版的
http://www.xkyn.com/Soft/soft/rar/Soft_6.htm
二、不要直接雙擊下載的windows media player 11的安裝文件,而在這個(gè)文件上點(diǎn)鼠標(biāo)右鍵,選“解壓到‘wmp11-windowsxp-x86-zh-cn’”,或者選“用winrar打開”,總之,用winrar解壓這個(gè)文件。
三、解壓的文件:
可以看到許多的文件,其中有四個(gè)EXE擴(kuò)展名結(jié)尾的可執(zhí)行文件。
我們依次運(yùn)行這四個(gè)文件就可以安裝windows media player 11 了。注意運(yùn)行這個(gè)四個(gè)文件的順序是:
1.umdf.exe
2.wmdbexport.exe
3.wmfdist11.exe
4.wmp11.exe
都執(zhí)行了以后,馬上去打開你的windows media player吧 系統(tǒng)會(huì)自動(dòng)對數(shù)據(jù)庫進(jìn)行升級,然后就可以看到華麗的界面
方法五: (也就是劍風(fēng)用的方法,適用于不是正版的xp系統(tǒng)卻又點(diǎn)擊了驗(yàn)證,失敗導(dǎo)致無法安裝的)
1、 安裝windows media player11,點(diǎn)擊驗(yàn)證,通不過,點(diǎn)擊完成;
2、再次安裝windows media player11,先不要急著點(diǎn)擊驗(yàn)證,切記切記!
3、打開C:\Documents and Settings\All Users\Application Data\ (復(fù)制到地址欄) 刪除Windows Genuine Advantage這個(gè)文件夾,然后斷開網(wǎng)絡(luò),在網(wǎng)上鄰居上禁用本地連接,如果你找不到干脆拔掉網(wǎng)線好了:)
posted @
2007-04-22 12:01 流浪汗 閱讀(24021) |
評論 (32) |
編輯 收藏
今天試用了JSP空間,
程序與提供商有一些矛盾,提供商允許我們改server.xml
那問題就來,我用了JNDI
這早就意識到,就把JNDI抽取到conf/Catalina/localhost目錄
如test.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/test" reloadable="true" docBase="D:\web\test" workDir="D:\web\test\WEB-INF\work">
<Resource
name="jdbc/TEST"
type="javax.sql.DataSource"
password=""
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost:3306/test"
maxActive="4"/>
</Context>
這還是麻煩,最后技術(shù)人員建議在META-INF/目錄下放context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource
name="jdbc/TEST"
type="javax.sql.DataSource"
password=""
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost:3306/test"
maxActive="4"/>
</Context>
posted @
2007-04-20 22:24 流浪汗 閱讀(889) |
評論 (0) |
編輯 收藏
默認(rèn)UTF8 mysql 數(shù)據(jù)庫備份數(shù)據(jù)為默認(rèn)GBK 的mysql數(shù)據(jù)庫導(dǎo)入
mysqldump -u root --add-drop-table --default-character-set=gbk tab1 > e:/tab1.sql
備份出來的數(shù)據(jù)只是文件編碼為GBK, 很個(gè)表還是原來的字符集(這里是UTF8)
posted @
2007-04-10 23:23 流浪汗 閱讀(443) |
評論 (0) |
編輯 收藏
收集于網(wǎng)絡(luò)
剛裝了FC6,由于在教育網(wǎng),無法使用yum默認(rèn)的國外更新源,因此需要將其設(shè)置為國內(nèi)鏡像站點(diǎn)。在網(wǎng)上找了一圈,發(fā)現(xiàn)清華的 ftp://ftp3.tsinghua.edu.cn這個(gè)更新源不錯(cuò)。參考網(wǎng)上的一些方法,設(shè)置yum更新源步驟如下:
1. 將/etc/yum.repos.d/下的已有更新源(repo文件)的enable改為0。為了方便起見,可以直接 mv /etc/yum.repos.d /etc/yum.repos.d.bak重命名,這樣就讓系統(tǒng)找不到原有的repo文件了。
2. 修改/etc/yum.conf文件,添加如下內(nèi)容:
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[extras]
name=Fedora Extras $releasever - $basearch
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/extras/6/i386
enabled=1
[updates]
name=Fedora Core $releasever - $basearch - Updates
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/updates/6/i386
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[core]
name=Fedora Core $releasever - $basearch
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os
enable=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
3. 經(jīng)過上述步驟后,就可以使用速度較快的國內(nèi)鏡像站點(diǎn)作為yum更新源了。
后記:在使用yum進(jìn)行install時(shí),經(jīng)常會(huì)出現(xiàn)下面的錯(cuò)誤
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 1ac70ce6
導(dǎo)致安裝不能進(jìn)行。解決方法如下:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
附:上述步驟的參考文獻(xiàn)
http://cocooker.gro.clinux.org/system-source.html 1.3. 軟件源的設(shè)置
http://www.neupioneer.com/city/blog/more.asp?name=codered&id=33152 南嶺梅香-我的FC6安裝配置日志
http://www.linuxsir.org/bbs/showthread.php?t=209957 yum安裝時(shí)下載完畢,但卻出現(xiàn)warning!Help!!!!
posted @
2007-04-09 19:30 流浪汗 閱讀(2095) |
評論 (0) |
編輯 收藏
連接代碼請看
http://bbs.mysql.cn/thread-98-1-2.html
mysql的JDBC驅(qū)動(dòng)下載
http://bbs.mysql.cn/thread-317-1-1.html
mysql備份與恢復(fù)
http://bbs.mysql.cn/thread-974-1-3.html
http://bbs.mysql.cn/thread-768-1-10.html
關(guān)于MYSQL數(shù)據(jù)的導(dǎo)出導(dǎo)入與版本的轉(zhuǎn)換
http://bbs.mysql.cn/viewthread.php?tid=72&extra=page%3D1%26filter%3Ddigest
如何增加用戶
http://bbs.mysql.cn/thread-535-1-12.html
改密碼
http://bbs.mysql.cn/thread-280-1-8.html
亂碼
http://bbs.mysql.cn/thread-1352-1-5.html
http://bbs.mysql.cn/thread-922-1-1.html
http://bbs.mysql.cn/viewthread.php?tid=1320&highlight=mysqld
遠(yuǎn)程連接MYSQL的問題
http://bbs.mysql.cn/viewthread.php?tid=1892&page=1&extra=#pid9349
PHP5,怎么連接MYSQL數(shù)據(jù)庫,不能加載
http://bbs.mysql.cn/thread-342-1-12.html
http://bbs.mysql.cn/thread-181-1-1.html
#1251
http://bbs.mysql.cn/viewthread.php?tid=1591&highlight=%231251
http://bbs.mysql.cn/viewthread.php?tid=319&highlight=%231251
http://bbs.mysql.cn/viewthread.php?tid=3597
編碼
http://bbs.mysql.cn/viewthread.php?tid=1320&extra=page%3D1%26amp%3Bfilter%3Ddigest
http://bbs.mysql.cn/thread-33-1-15.html
http://bbs.mysql.cn/thread-72-1-1.html
WIN服務(wù)
http://bbs.mysql.cn/thread-3207-1-1.html
tool
http://bbs.mysql.cn/thread-3526-1-1.html
sql-front
http://bbs.mysql.cn/thread-3193-1-1.html
#1045
http://bbs.mysql.cn/viewthread.php?tid=4430&highlight=1045
timeout
http://bbs.mysql.cn/thread-5215-1-5.html
limit
http://bbs.mysql.cn/thread-4949-1-5.html
mysql refence(PDF)
http://bbs.mysql.cn/thread-5775-1-1.html
如何用SQL語句在MYSQL中建立主外鍵關(guān)系
http://bbs.mysql.cn/viewthread.php?tid=7057&page=1&extra=page%3D2#pid27486
mysql-front3.2教程
http://bbs.mysql.cn/viewthread.php?tid=7129&page=1&extra=page%3D1#pid27500
mysql5.0忘記root密碼
http://bbs.mysql.cn/thread-7765-1-1.html
優(yōu)秀的 MySQL 管理工具:Navicat MySQL
http://bbs.mysql.cn/thread-6346-1-1.html Navicat MySQL Client v7.2.9下載地址:
http://www.mycodes.net/soft/9642.htm
posted @
2007-04-07 12:18 流浪汗 閱讀(494) |
評論 (0) |
編輯 收藏
1.下載mysql認(rèn)證模塊,mod_auth_mysql_2.0.29.win32.zip
下載地址:http://www.gknw.net/development/apache/httpd-2.0/win32/modules
將.so文件拷貝到Apache的modules目錄下。
2.配置httpd.conf
a. 增加模塊載入
LoadModule mysql_auth_module? modules/mod_auth_mysql.so
b. SVN認(rèn)證
<Location /svnroot>
DAV svn
SVNPath g:/svnroot/? #如果是總目錄,則為SVNParentPath
AuthName? “SVNRoot Auth"
AuthType??? Basic
Require???? valid-user
AuthMySQLHost??? localhost
AuthMySQLUser?? root
AuthMySQLPassword??? *******
AuthMySQLDB???? svn
AuthMySQLUserTable??? svnusers
AuthMySQLNameField?? username
AuthMySQLPasswordField??? password
AuthMySQLMD5Passwords?? On
</Location>
3. 如果在數(shù)據(jù)庫認(rèn)證時(shí)出現(xiàn)錯(cuò)誤
在Apache的errors.log中顯示客戶端的版本有問題,進(jìn)入Mysql,執(zhí)行以下命令
set password for 'root'@localhost=OLD_APSSWORD('******');
4.要進(jìn)一步控制訪問權(quán)限,要加上:
AuthzSVNAccessFile??? "e:\Apache\conf\svnauthz.conf"
轉(zhuǎn)載: http://blog.csdn.net/abetman/archive/2007/03/05/1520730.aspx
posted @
2007-04-01 19:07 流浪汗 閱讀(1474) |
評論 (0) |
編輯 收藏