2016年4月21日 星期四
2016年4月14日 星期四
Jhiptser 使用 SQL Server Tips (Liquibase Mavenplugin)
可考官網說明
https://jhipster.github.io/tips/004_tip_using_ms_sql_server.html
由於MSSQL Driver 無法直接由 Maven repository取得
若需使用Maven Liquibase plugin 來 針對MS SQL Server 操作, 須依下列步驟執行
1. 安裝 MS SQL Server JDBC Driver 於本地端Maven local repository
mvn install:install-file -Dfile=D:\dev\java\jars\sqljdbc4.jar -DgroupId=sqljdbc4 -DartifactId=sqljdbc4 -Dversion=4 -Dpackaging=jar -DgeneratePom=true
2. 將 MS SQL Server JDBC dependency 加到 Maven pom.xml
3. 執行以下指令確認 Maven 可正常執行
mvn -P dev liquibase:generateChangeLog
2016年4月11日 星期一
LiquiBase: Inserting data from a CSV file
How to resolve issue importing Date field
https://lizdouglass.wordpress.com/2009/02/01/liquibase-inserting-data-from-a-csv-file/
2016年3月31日 星期四
RTP over Websocket
http://stackoverflow.com/questions/18844534/rtp-over-websocket
WebRtc sample application
2016年3月30日 星期三
JHipster Liquibase 指令範例 - Maven
JHipster 已經在POM.XML 做好 Liquibase的基本設定, 因此在JHipster Code Generate 出的專案中, 可以直接利用 Maven指令, 在Project 目錄下利用 mvn 的 command line 指令, 即可Reverse database schema 以及Diff出schema與 data 的修改.
1. 設定說明
2. 利用 Reverse 產出全部資料的 XML
mvn -P dev liquibase:generateChangeLog
-P : 指定Spring boot 在 Maven 定義的Profile
generateChangeLog: reverse 全部資料
mvn -P dev liquibase:generateChangeLog -Dliquibase.outputChangeLogFile=./test.xml
-Dliquibase.outputChangeLogFile: 自指定產出的XML檔案, 未指定則輸出到console
3. 利用 Diff 產出資料修改的 XML
mvn liquibase:diff
Spring boot預設的Profile與在pom.xml 設定在 <referenceUrl> 的料庫比對
mvn -P prod liquibase:diff
-P : 指定Spring boot 在 Maven 定義的Profile, 與在pom.xml 設定在 <referenceUrl> 的料庫比對
4. 利用updateSQL產出SQL指令( 不直接對資料庫下指令)
mvn liquibase:updateSQL
5. 利用dropAll指令清除所有table
mvn -P prod liquibase:dropAll
5. 利用clearCheckSums指令清除所有CheckSums以避免checkSum Error
mvn -P prod liquibase:clearCheckSums
5. 利用Batch 指令執行Liquibase的Sample
// 從資料庫Reverse為Liquibase XML檔, 將changeLogFile附檔名改為.json即可改JSON格式
liquibase --driver=com.mysql.jdbc.Driver --classpath=.\mysql-connector-java-5.1.38.jar --changeLogFile=db.changelog.xml --url="jdbc:mysql://localhost:3306/dev?useUnicode=true&characterEncoding=UTF-8" --username=pollex --password=pollex123 generateChangeLog
// 連同 Data 一起 Reverse
liquibase --driver=com.mysql.jdbc.Driver --classpath=.\mysql-connector-java-5.1.38.jar --changeLogFile=db.changelog.xml --url="jdbc:mysql://localhost:3306/dev?useUnicode=true&characterEncoding=UTF-8" --diffTypes=data --username=pollex --password=pollex generateChangeLog
//產出對資料庫建資料的SQL SCRIPT
liquibase --driver=com.mysql.jdbc.Driver --classpath=.\mysql-connector-java-5.1.38.jar --changeLogFile=db.changelog.json --url="jdbc:mysql://localhost:3306/dev?useUnicode=true&characterEncoding=UTF-8" --username=pollex --password=pollex updateSQL > dbscript.sql
--diffTypes=data,tables,columns,views,primaryKeys,uniqueConstraints,indexes,foreignKeys,sequences
2016年2月16日 星期二
IMs
https://theimsjungle.wordpress.com/tag/i-cscf/
http://www.projectclearwater.org/about-clearwater/
http://www.projectclearwater.org/about-clearwater/
2016年2月14日 星期日
訂閱:
文章 (Atom)