Java Tour

           

          2012年11月11日

          jQuery操作json數(shù)據(jù)給form表單賦值

               摘要: 頁面表單:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><!DOCTYPE html><html lang="en"><head>    <meta...  閱讀全文

          posted @ 2023-03-04 01:58 花滿樓 閱讀(61) | 評(píng)論 (0)編輯 收藏

          logback配置備忘

          資源pom.xml
          <properties>
          <slf4j.version>1.7.1</slf4j.version>
          <log4j.version>1.2.17</log4j.version>
          <logback.version>1.0.1</logback.version>
          </properties>
          <dependencyManagement>
                  <dependencies>
                  
                  <!-- logging related -->
                      <!-- slf4j -->
                      <dependency>
                          <groupId>org.slf4j</groupId>
                          <artifactId>slf4j-api</artifactId>
                          <version>${slf4j.version}</version>
                      </dependency>

                      <!-- common-logging 實(shí)際調(diào)用slf4j -->
                      <dependency>
                          <groupId>org.slf4j</groupId>
                          <artifactId>jcl-over-slf4j</artifactId>
                          <version>${slf4j.version}</version>
                          <scope>runtime</scope>
                      </dependency>


                      <!-- java.util.logging 實(shí)際調(diào)用slf4j -->
                      <dependency>
                          <groupId>org.slf4j</groupId>
                          <artifactId>jul-to-slf4j</artifactId>
                          <version>${slf4j.version}</version>
                          <scope>runtime</scope>
                      </dependency>

                      <!-- slf4j-log4j綁定 -->
                      <dependency>
                          <groupId>org.slf4j</groupId>
                          <artifactId>slf4j-log4j12</artifactId>
                          <version>${slf4j.version}</version>
                          <scope>runtime</scope>
                      </dependency>
                      
                      <dependency>
                          <groupId>org.slf4j</groupId>
                          <artifactId>log4j-over-slf4j</artifactId>
                          <version>${slf4j.version}</version>
                          <scope>runtime</scope>
                      </dependency>
                      
                      <!-- logback -->
                      <dependency>
                          <groupId>ch.qos.logback</groupId>
                          <artifactId>logback-core</artifactId>
                          <version>${logback.version}</version>
                          <scope>runtime</scope>
                          <optional>true</optional>
                      </dependency>
                      <dependency>
                          <groupId>ch.qos.logback</groupId>
                          <artifactId>logback-classic</artifactId>
                          <scope>runtime</scope>
                          <version>${logback.version}</version>
                          <optional>true</optional>
                      </dependency>
                      <dependency>
                          <groupId>ch.qos.logback</groupId>
                          <artifactId>logback-access</artifactId>
                          <version>${logback.version}</version>
                          <scope>runtime</scope>
                          <optional>true</optional>
                      </dependency>
              </dependencies>
          </dependencyManagement>        

          a.slf4j/logback 組合(logback.xml)
          <!-- slf4j -->
                  <dependency>
                      <groupId>org.slf4j</groupId>
                      <artifactId>slf4j-api</artifactId>        
                  </dependency>
                  <dependency>
                      <groupId>ch.qos.logback</groupId>
                      <artifactId>logback-core</artifactId>
                  </dependency>
                  <dependency>
                      <groupId>ch.qos.logback</groupId>
                      <artifactId>logback-classic</artifactId>
                  </dependency>

          b.slf4j/log4j組合(log4j.properties or log4j.xml)
          <!-- slf4j -->
          <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>slf4j-api</artifactId>
          </dependency>
          <!-- log4j -->
          <dependency>
              <groupId>log4j</groupId>
              <artifactId>log4j</artifactId>
          </dependency>
          <!-- slf4j-log4j綁定 -->
          <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>slf4j-log4j12</artifactId>
          </dependency>

          c.如果是已用了commons-logging/log4j想用用slf4j/logback,那也容易用下面的配置
          <!-- slf4j -->
          <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>slf4j-api</artifactId>
          </dependency>
          <!-- common-logging 實(shí)際調(diào)用slf4j -->
          <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>jcl-over-slf4j</artifactId>
          </dependency>
          <!-- log4j -->
          <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>log4j-over-slf4j</artifactId>
          </dependency>
          <dependency>
              <groupId>ch.qos.logback</groupId>
              <artifactId>logback-core</artifactId>
          </dependency>
          <dependency>
              <groupId>ch.qos.logback</groupId>
              <artifactId>logback-classic</artifactId>
          </dependency>            
          再到http://logback.qos.ch/translator/Welcome.do,將你原來的log4j.properties轉(zhuǎn)成logback.xml
          就可以將commons-logging.jar 跟 log4j.jar自你系統(tǒng)中移除了



          posted @ 2012-11-16 09:33 花滿樓| 編輯 收藏

          mysql 主從庫環(huán)境搭建 手記

          環(huán) 境 
          a.下載 BeanSoft的綠色版mysql (Copy 成兩份 ,master,slave) 取mysql\mysql50green下內(nèi)容復(fù)制
          b. 在cmd命令行模式下進(jìn)入master \bin  執(zhí)行mysqld install  master命令。作用是為Mysql安裝一個(gè)服務(wù),服務(wù)名是 master 。同理操作slave 。(注意 mysqld =mysqld-nt

          c. 在運(yùn)行里運(yùn)行REGEDIT,打開WINDOWS注冊(cè)表編輯器,
          在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\master 打開,
          修改下面的ImagePath數(shù)值: "X:\ master \bin\mysqld" --defaults-file="D:\master\my.ini"  master 
          確定,退出注冊(cè)表編輯器。 (同理操作slave)
          d.定義my.ini拷貝到 X:\ master  下面
          [client]
             port = 3308
             [mysqld]
              port           =3308
              server-id    = 1
              binlog-do-db=test1  ##要同步的數(shù)據(jù)庫名為test1 
              log-bin    =mysql-bin
          e.定義my.ini拷貝到x:\slave下面
          [client]
             port        = 3309

             [mysqld]
             port        = 3309
             server-id       = 2

             master-host     =   127.0.0.1

             master-user     =   slaver1

             master-password =   slaver1pwd

             master-port     =  3308

             replicate-do-db=test1  ##要同步的數(shù)據(jù)庫
          f.  

          然后在master 
          Console 執(zhí)行: GRANT FILE,SELECT,REPLICATION SLAVE ON *.* TO 'slaver1'@'127.0.0.1' IDENTIFIED BY 'slaver1pwd';
          開一個(gè)新賬號(hào)(用戶名:slaver1 密碼:slaver1pwd)并賦于權(quán)限 
          運(yùn)行Mysqld.exe,并創(chuàng)建新數(shù)據(jù)庫test1,可在Console下輸入:show master status\G查看狀態(tài)!

             *************************** 1. row*****************
                      File: mysql-bin.000305
                      Position: 98
                      Binlog_Do_DB: test1
                      Binlog_Ignore_DB:

          g.

           運(yùn)行Slaver 的Mysqld.exe,在Console窗口執(zhí)行 show slave status\G  查看狀態(tài),如下:

          mysql> show slave status\G
          *************************** 1. row ***************************
                       Slave_IO_State: Waiting for master to send event
                          Master_Host: 127.0.0.1
                          Master_User: slaver1
                          Master_Port: 3308
                        Connect_Retry: 60
                      Master_Log_File: mysql-bin.000002
                  Read_Master_Log_Pos: 2495
                       Relay_Log_File: 2012-0416-1022-relay-bin.000007
                        Relay_Log_Pos: 235
                Relay_Master_Log_File: mysql-bin.000002
                     Slave_IO_Running: Yes
                    Slave_SQL_Running: Yes
                      Replicate_Do_DB: test1
                  Replicate_Ignore_DB: 
                   Replicate_Do_Table: 
               Replicate_Ignore_Table: 
              Replicate_Wild_Do_Table: 
          Replicate_Wild_Ignore_Table: 
                           Last_Errno: 0
                           Last_Error: 
                         Skip_Counter: 0
                  Exec_Master_Log_Pos: 2495
                      Relay_Log_Space: 235
                      Until_Condition: None
                       Until_Log_File: 
                        Until_Log_Pos: 0
                   Master_SSL_Allowed: No
                   Master_SSL_CA_File: 
                   Master_SSL_CA_Path: 
                      Master_SSL_Cert: 
                    Master_SSL_Cipher: 
                       Master_SSL_Key: 
                Seconds_Behind_Master: 0
          1 row in set (0.00 sec)



          posted @ 2012-11-11 17:10 花滿樓| 編輯 收藏

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿

          隨筆檔案

          友情鏈接

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 扶风县| 西丰县| 水富县| 泰宁县| 徐州市| 玛多县| 朝阳市| 永平县| 囊谦县| 忻州市| 柳林县| 永吉县| 祁门县| 金湖县| 涟水县| 新沂市| 喀喇沁旗| 泗洪县| 克什克腾旗| 卢氏县| 大石桥市| 博客| 马山县| 德化县| 永胜县| 依兰县| 巫山县| 凉城县| 博兴县| 定日县| 嘉定区| 苍梧县| 霍州市| 永福县| 达尔| 乳山市| 疏附县| 黔西| 肥乡县| 睢宁县| 岳西县|