LINUX底下修改 mysql 設定檔
指令:
vi /etc/mysql/my.cnf
修改以下
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
2013年9月9日 星期一
2013年3月19日 星期二
Oracle SQL SYS_CONNECT_BY_PATH 合併多行字符串
select temp.c1, substr(max(SYS_CONNECT_BY_PATH(c2,',')),2) as c_list
from (select c2, c1, ROW_NUMBER() OVER (PARTITION BY c2 ORDER BY c1) as rn
from table1
where c1 = 'A123456789'
order by c1) temp
START WITH temp.rn = 1
CONNECT BY temp.c1 = PRIOR temp.c1
and temp.rn -1 = PRIOR temp.rn
GROUP BY temp.c1
order by temp.c1;
參考:http://hsunya.wordpress.com/2010/10/13/oracle-sys_connect_by_path/
from (select c2, c1, ROW_NUMBER() OVER (PARTITION BY c2 ORDER BY c1) as rn
from table1
where c1 = 'A123456789'
order by c1) temp
START WITH temp.rn = 1
CONNECT BY temp.c1 = PRIOR temp.c1
and temp.rn -1 = PRIOR temp.rn
GROUP BY temp.c1
order by temp.c1;
參考:http://hsunya.wordpress.com/2010/10/13/oracle-sys_connect_by_path/
2012年12月16日 星期日
Eclipse 啟動時卡住問題
Eclipse在啟動時卡住 停在loading org.eclipse.debug.core
解決方法
刪除
.metadata\.plugins\org.eclipse.core.resources\.root\.markers.snap
解決方法
刪除
.metadata\.plugins\org.eclipse.core.resources\.root\.markers.snap
不行在刪除.metadata\.plugins\org.eclipse.core.resources\.projects\<project>\.markers.snap如果還不行刪除 .metadata\.plugins\org.eclipse.core.resources\.snap
2012年8月5日 星期日
Deploy Error : A composition unit with name already exists. Select a different application name
from: http://turanunes.wordpress.com/2011/09/21/deploy-error-a-composition-unit-with-name-already-exists-select-a-different-application-name/
When installing an application or performing other administrative actions in WebSphere Application Server version 7.x, the following error is received:
”A composition unit with name already exists. Select a different application name”
Resolving the Problem :
There are some temp file s on the Websphere server , you can delete them…
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/(CellName)/blas/(AppName)
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/(CellName)/cus/(AppName)
and also you can delete
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/wstemp/*.*
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/isprodwas61Cell01/blas/(AppName)
window==>
C:\Program Files (x86)\IBM\SDP75\runtimes\base_v7\profiles\was70profile1\config\cells\lunayccleo-VAIONode01Cell\blas
C:\Program Files (x86)\IBM\SDP75\runtimes\base_v7\profiles\was70profile1\config\cells\lunayccleo-VAIONode01Cell\cus
C:\Program Files (x86)\IBM\SDP75\runtimes\base_v7\profiles\was70profile1\wstemp
2012年7月5日 星期四
2012年4月30日 星期一
Open multiple eclipse workspace in Mac
1. use command line to go to your eclipse folder
cd /Documents/eclipse
2. open eclipse as follow
cd /Documents/eclipse
2. open eclipse as follow
./eclipse &2012年4月29日 星期日
Eclipse configure reference project
when your web project in eclipse need to use classes from java project
then you need to set up your java project as your reference project
1 configure project dependency
2.add require project
then you need to set up your java project as your reference project
1 configure project dependency
2.add require project
2012年4月14日 星期六
setting up apache-solr in eclipse with tomcat
1.download apache solr
http://lucene.apache.org/solr/index.html
2.import apache-solr-xx.war into your eclipse
3.copy solr config (apache-solr-3.5.0\client\ruby\solr-ruby\solr\conf) into your dynamic web project
your project should look something like this
4. define solr home in your web.xml
add the following in your web.xml
the marked text is the location of your solr config in your web project
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>C:/LeoProject/apache-solr-3.5.0/solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
5. now you can run your solr in eclipse with tomcat
http://lucene.apache.org/solr/index.html
2.import apache-solr-xx.war into your eclipse
3.copy solr config (apache-solr-3.5.0\client\ruby\solr-ruby\solr\conf) into your dynamic web project
your project should look something like this
4. define solr home in your web.xml
add the following in your web.xml
the marked text is the location of your solr config in your web project
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>C:/LeoProject/apache-solr-3.5.0/solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
5. now you can run your solr in eclipse with tomcat
2012年4月11日 星期三
eclipse jd-gui complier install
eclipse class 反編譯器外掛安裝方式
請參照
http://java.decompiler.free.fr/?q=jdeclipse
上面的連結已失效
請使用這個
http://mchr3k-eclipse.appspot.com/
請參照
http://java.decompiler.free.fr/?q=jdeclipse
上面的連結已失效
請使用這個
http://mchr3k-eclipse.appspot.com/
2012年4月7日 星期六
Tomcat SSL support for Spring Security and CAS
最近為了整合Spring Security 和 CAS (Central Authentication Service)
(HTTPS是CAS SERVER的默認訪問通道,由於考慮到安全性,數據都經過通過SSL通道加密傳送)
在本機開發時須配置Tomcat支持SSL服務
以下為配置步驟:
生成SSL證書
(HTTPS是CAS SERVER的默認訪問通道,由於考慮到安全性,數據都經過通過SSL通道加密傳送)
在本機開發時須配置Tomcat支持SSL服務
以下為配置步驟:
生成SSL證書
Window
1.刪除 %JRE_HOME%/lib/security/cacerts
2.生成證書
keytool -genkey -alias tomcat -keyalg RSA -keystore C:/tomcat
3.匯出證書
keytool -export -file C:/tomcat.crt -alias tomcat -keystore C:/tomcat
4.導入證書
keytool -import -keystore C:/"Program Files"/Java/jre6/lib/security/cacerts -file C:/tomcat.crt -alias tomcat
Mac
1.生成證書
keytool -genkey -alias tomcat -keyalg RSA -keystore /Users/lunayccleo/Documents/keys/tomcat
2.繪出證書
keytool -export -file /Users/lunayccleo/Documents/keys/tomcat.crt -alias tomcat -keystore /Users/lunayccleo/Documents/keys/tomcat
3.導入證書
sudo keytool -import -keystore /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts -file /Users/lunayccleo/Documents/keys/tomcat.crt -alias tomcat
keytool -export -file /Users/lunayccleo/Documents/keys/tomcat.crt -alias tomcat -keystore /Users/lunayccleo/Documents/keys/tomcat
3.導入證書
sudo keytool -import -keystore /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts -file /Users/lunayccleo/Documents/keys/tomcat.crt -alias tomcat
ps:刪除憑證讓你可以重新匯入相同名字的憑證
sudo keytool -delete -keystore /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts -alias tomcat
sudo keytool -delete -keystore /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts -alias tomcat
Default password is
jdk 憑證 (cacerts)預設密碼:
changeitjdk 憑證 (cacerts)預設密碼:
changeit
Tomcat
server.xml 加入
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true" clientAuth="false"
sslProtocol="TLS" keystoreFile="C:/tomcat"
keystorePass="changeit" />
2012年3月21日 星期三
2012年2月28日 星期二
enable Spring Transaction Annotation
enable Spring Transaction Annotation
in your springConfig.xml
add the following
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
in your springConfig.xml
add the following
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>${jndi}</value>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- enable transaction annotation -->
<tx:annotation-driven transaction-manager="transactionManager"/>
2012年2月12日 星期日
2012年2月7日 星期二
Linux 底下MySQL 指令
啟動 MySQL
# mysql -u root
初次使用是不用輸入密碼。
mysql>\ quit
# mysqladmin -u root password 'password'
從此以後 MySQL 的 root 帳號就需要密碼了!
如下所示:
# mysql -u root -p
password: 密碼
mysql>update user set password=password('password') where user='root';
設定root的密碼。
mysql>\ show databases;
顯示all databases。
mysql> \use database's name;
選擇指定的database。
mysql>\ show tables;
顯示all tables in database。
# /etc/init.d/mysql stop
關掉MySQL。
如果你想進行遠程訪問或控制,那麼你要做兩件事:
1.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
授權讓遠端登入,可以把 '%' 改成主機的IP
2.
老的版本中
>skip-networking => # skip-networking
新的版本中
>bind-address=127.0.0.1 => bind-address= 你機器的IP
2012年2月1日 星期三
JSP 防止快取
在程式開頭加入以下
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevent caching at the proxy server
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevent caching at the proxy server
2012年1月30日 星期一
2012年1月15日 星期日
IE6,IE7 position absolute問題
在IE6,IE7 CSS設定position:absolute;時需要加上left:0px;
,顯示時才會和其他瀏覽器一致
FireFox/Chrome預設為left:0px;但IE6,IE7預設似乎是置中
導致沒有設定left:0px;時IE6,IE7看起來和其他瀏覽器不同
,顯示時才會和其他瀏覽器一致
FireFox/Chrome預設為left:0px;但IE6,IE7預設似乎是置中
導致沒有設定left:0px;時IE6,IE7看起來和其他瀏覽器不同
2012年1月2日 星期一
JAVA讀取資料換行
讀取檔案時(文字檔,EXCEL等等)
換行的符號 '\n'
ENTER的符號 '\r'
可以用String.replace("\n","替代的文字"), String.split("\n") 等等來做對應處理
換行的符號 '\n'
ENTER的符號 '\r'
可以用String.replace("\n","替代的文字"), String.split("\n") 等等來做對應處理
2011年12月27日 星期二
WebSphere Community Edition 版本 Ubuntu底下操作紀錄
啟動
cd /opt/IBM/WebSphere/AppServerCommunityEdition/bin
看server log
tail -f /opt/IBM/WebSphere/AppServerCommunityEdition/var/log/server.out
網頁管理介面
http://localhost:8080/console
cd /opt/IBM/WebSphere/AppServerCommunityEdition/bin
sh startup.sh
看server log
tail -f /opt/IBM/WebSphere/AppServerCommunityEdition/var/log/server.out
網頁管理介面
http://localhost:8080/console
預設帳密:
login:system
password:manager
2011年12月25日 星期日
Ubuntu install MySQL
sudo apt-get install mysql-server
http://wiki.ubuntu.org.cn/MySQL%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97
http://wiki.ubuntu.org.cn/MySQL%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97
登入MySQL
mysql -u root
訂閱:
意見 (Atom)



