<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)編輯 收藏
    1. Background

             Usually,When we develop our web application,we need create menu.We can use Javascript to design web menu,but if thus,we have to compile many codes,and our application hasn't good  revisability and maintainability .Struts-menu provides us a convenient web menu design way,we can put our web menu data in  a menu-config.xml configuration file,and read the data with struts-menu lable.

       2.  Struts  Menu Example
        
            You can go here http://demo.raibledesigns.com/struts-menu/ to see the example;
            Or download the example application :struts-menu-2.3.zip,follow the below instruction:  
                   Unzip it to a local directory.  
                   Download and install Tomcat or another Java Servlet container.  
                   Put struts-menu.war in Tomcat's webapps folder and start the server. 
                   Go to http://localhost:8080/struts-menu 

     3.   Integrating Struts Menu into your application

          1.  Place struts-menu-2.3.jar into your app's WEB-INF/lib directory.(maybe you also need put common-lang.jar)
          2.  Place struts-menu.tld,and struts-menu-el.tld into your app's WEB-INF directory
          3.  Copy the common,images,scripts,template,styles directory from the above struts-menu.war exmaple application  to your web directory.(if use Myeclipse,put those directorys in webroot directory)
          4.  Add the plug-in settings to your struts-config.xml file.                 
                 
                   <plug-in className="net.sf.navigator.menu.MenuPlugIn">
                             <set-property property="menuConfig"
                                         value="/WEB-INF/menu-config.xml"/>
                    </plug-in>
         
            5.  You will need to declare your menu's attributes in a your App /WEB-INF/menu-config.xml file.Here's  a short  snippet of what might look like:        
           
                 <Menu name="contactMenu" title="Contact" location="?Contact">
                      <Item name="email" title="E-Mail" location="?EMail"/>
                      <Item name="phone" title="Phone" location="?Phone"/>
                 </Menu>
        
             6.   Add a taglib declaration to the top of your JSP: 

            <%@ taglib uri="http://struts-menu.sf.net/tag" prefix="menu" %>

            7.  Add taglib code to render your menu in your JSP: 

                   <menu:useMenuDisplayer name="TabbedMenu"
                       bundle="org.apache.struts.action.MESSAGE">
                        <menu:displayMenu name="Home"/>
                        <menu:displayMenu name="About"/>
                   </menu:useMenuDisplayer>
           
              
           8.  Below is a whole test.jsp
                <%@ page contentType="text/html; charset=UTF-8" %>
                <%@ taglib uri="            <%@ taglib uri="            <html:html>
                 <head>
                 <html:base />
                     <title>menu</title>
       
                     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

          
                     <link rel="stylesheet" type="text/css" media="screen"
                                   href="styles/global.css" />
                          <link rel="stylesheet" type="text/css" media="screen"
                                  href="styles/coolmenu.css" />
        
                    <script type="text/javascript" src="scripts/coolmenus4.js"></script>
                    <script type="text/javascript" src="scripts/cm_addins.js"></script>
                </head>
     
                <body>
                   <script type="text/javascript" src="scripts/coolmenu4-config.js"></script> 
       
                   <menu:useMenuDisplayer name="CoolMenu4"
                       bundle="org.apache.struts.action.MESSAGE">
                       <menu:displayMenu name="Home"/>
                      <menu:displayMenu name="About"/>
                  </menu:useMenuDisplayer>
              </body>
           </html:html>








                  
            

    主站蜘蛛池模板: 亚洲视屏在线观看| 亚洲老熟女五十路老熟女bbw | 亚洲AV无码一区二区三区电影| 又粗又硬免费毛片| 久久免费福利视频| 中文字幕亚洲综合久久综合| 国产亚洲精品不卡在线| 97在线视频免费公开观看| 亚洲日韩中文字幕无码一区| 亚洲日韩在线观看| 亚洲人成在线免费观看| 精品在线免费视频| 亚洲国产精品白丝在线观看 | 亚洲国产日韩在线| 亚洲国产综合精品中文字幕| 91老湿机福利免费体验| 视频一区在线免费观看| 亚洲美女人黄网成人女| 亚洲AV无码乱码在线观看| 永久看日本大片免费35分钟| 一级视频免费观看| 亚洲av无码一区二区三区观看| 亚洲国产精品无码久久九九| 91频在线观看免费大全| 国产色爽免费无码视频| 亚洲AV女人18毛片水真多| 亚洲视频在线一区| 亚洲人成色7777在线观看不卡| 亚洲欧洲免费无码| 日本免费在线观看| 人碰人碰人成人免费视频| 中文字幕亚洲男人的天堂网络| 国产AV无码专区亚洲精品| 国产国产人免费视频成69大陆| xxxxwww免费| 久久青草免费91线频观看不卡 | 亚洲视频一区在线| 亚洲乱色熟女一区二区三区丝袜| 国产三级免费电影| 狼友av永久网站免费观看| 日韩视频在线精品视频免费观看|