<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    freefly
    一門技術,如果不能講出來,那么就是沒有理解,如果不能很好的講出來,那么就是理解不夠透徹!
    posts - 9,comments - 3,trackbacks - 0
    1。我們可以做一個平凡的人,但決不能做一個平庸的人
    2。給生活一個笑臉,生活會給你一個太陽
    3。路漫漫其修遠兮,情深深且珍惜
    posted @ 2007-01-16 13:56 freefly 閱讀(217) | 評論 (0)編輯 收藏
    1. create view

              ORACLE:    CREATE OR REPLACE VIEW V_FA_ADD_CO AS

                 SQLSEVER:    IF EXISTS (SELECT 1
                                                                FROM  sysobjects
                                                                WHERE  idobject_id ('V_FA_ADD_CO')
                                                                 AND   type = 'V')
                                        DROP VIEW V_FA_ADD_CO;
                                        CREATE VIEW V_FA_ADD_CO AS

        
    2. the equal between join and (+)
          
           the table(its fields stay with (+)) right  join another  corresponding   table.
           for example: select * from a,b where a.id=b.id(+)
                   equals  select * from b rigth join a on a.id=b.id
                   equals  select * from a left join a on a.id=b.id

            notes:join先匹配有對應的記錄,
                  (+)卻是按順序來的
     

        3. substr,substring
         
    for example: there is a table's field "userName" and it's value is "wanghuiling".
           sqlserver: substring(userName,0,4) = "wan",substring(userName,1,4) = "wang"
           oracle:  substr(userName,0,4)="wang",substr(userName,1,4)="wang"
       
     4. link sign
         sqlserver: "+"
        
    oracle:"||"
     
    5. update a table's some fields

         for example:there are two tables: students1 and students2

         sqlserver:update students     (can't use alias)
                       set name=s2.name,sex=s2.sex,age=s2.age,tel=s2.tel
                       from students s2 where s1.id=s2.id;
         oracle: update students1 s1
                   set (name,sex,age,tel)=
                   (select name,sex,age,tel from students2 s2 where s1.id=s2.id);

    6. Date
        for example:there are a field of  date type:input_date  and its value is 2007-08-09.   
        sqlserver : year(input_date)=2007,month(input_date)=8,day(input_date)=9
         oracle : to_char(input_date,'YYYY')=2007, to_char(input_date,'MM')=8, to_char(input_date,'DD')=9

         sDate : a java String variable
         sqlserver : input_date = '"+sDate+"' 
         oracle : input_date =  to_char( '" + sDate + "',' 'YYYY-MM-DD'')

    posted @ 2006-12-31 15:42 freefly 閱讀(568) | 評論 (0)編輯 收藏

          Ultimatelly,I solved my problem.    My work is switch my application from mysql to sqlserver database .   At the very start,I forgot start sqlserver service,so the error "refused connect"  always appear,(so stupid error).Next,ther error  "Hibernate operation: could not execute query; uncategorized SQLException for SQL [select user0_.ID as ID, user0_.USERNAME as USERNAME0_, user0_.PASSWORD as PASSWORD0_ from user user0_]; SQL state [S1000]; error code [156]; 在關鍵字 'user' 附近有語法錯誤。; nested exception is java.sql.SQLException: 在關鍵字 'user' 附近有語法錯誤."   comes out ,  the problem scratchs my head over .this moring i got one friend's help and eventually found the "user" should not be used as a table name,because "user" is a key in sqlserver.  
          Below is work I have done : (Note: my env is eclipse+myeclipse)
          First:modify applicationContext.xml:
          
          From:
          1.<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
               <property name="driverClassName">
                     <value>com.mysql.jdbc.Driver</value>
               </property>
               <property name="url">
                    <value>jdbc:mysql://localhost:3306/test</value>
               </property>
               <property name="username">
                    <value>root</value>
               </property>
               <property name="password">
                   <value>whl</value>
               </property>
            </bean>
         2. <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
         
         To:
            <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
                  <property name="driverClassName">
                       <value>net.sourceforge.jtds.jdbc.Driver</value>
                  </property>
                  <property name="url">
                       <value>jdbc:jtds:sqlserver://localhost:1433/test</value>
                   </property>
                   <property name="username">
                        <value>sa</value>
                   </property>
                   <property name="password">
                        <value>mssqlsys</value>
                  </property>
             </bean>

            <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
          Second: import the sqlserver driver:jtds-1.1.jar

    posted @ 2006-04-11 12:41 freefly 閱讀(355) | 評論 (0)編輯 收藏
    主站蜘蛛池模板: 亚洲色精品aⅴ一区区三区| 亚洲精品麻豆av| 亚洲欧洲国产视频| 久久精品国产免费一区| 国产av天堂亚洲国产av天堂| 国产亚洲精品免费视频播放| 亚洲欧洲日产国码无码网站| 中文字幕在线免费看线人| 亚洲成Av人片乱码色午夜| 国产精品区免费视频| 亚洲酒色1314狠狠做| 成人a免费α片在线视频网站| 在线aⅴ亚洲中文字幕| 日韩a在线观看免费观看| 国产成人亚洲综合在线| 亚洲无码高清在线观看| 中国一级特黄高清免费的大片中国一级黄色片 | 亚洲人成电影网站国产精品| av电影在线免费看| 亚洲av网址在线观看| 亚洲视频在线免费看| 久久综合久久综合亚洲| 免费一级一片一毛片| 91免费福利视频| 亚洲综合一区二区精品久久| 久久久www成人免费毛片 | 亚洲av女电影网| 97无码免费人妻超级碰碰夜夜 | 亚洲啪啪AV无码片| 999在线视频精品免费播放观看| 亚洲中文字幕无码av| 国产亚洲欧洲Aⅴ综合一区 | 在线播放国产不卡免费视频 | 在线a亚洲老鸭窝天堂av高清| 免费人成在线观看播放国产| 任你躁在线精品免费| 67194在线午夜亚洲| 亚洲中文字幕无码专区| 国内精自视频品线六区免费| 思思久久99热免费精品6 | 亚洲视频手机在线|