avtt亚洲天堂,97se亚洲国产综合自在线 ,伊人久久亚洲综合影院http://m.tkk7.com/freefly/category/27351.html一門技術,如果不能講出來,那么就是沒有理解,如果不能很好的講出來,那么就是理解不夠透徹!zh-cnThu, 15 Nov 2007 17:34:25 GMTThu, 15 Nov 2007 17:34:25 GMT60growing in depressed moodhttp://m.tkk7.com/freefly/archive/2006/04/11/40435.htmlfreeflyfreeflyTue, 11 Apr 2006 04:41:00 GMThttp://m.tkk7.com/freefly/archive/2006/04/11/40435.htmlhttp://m.tkk7.com/freefly/comments/40435.htmlhttp://m.tkk7.com/freefly/archive/2006/04/11/40435.html#Feedback0http://m.tkk7.com/freefly/comments/commentRss/40435.htmlhttp://m.tkk7.com/freefly/services/trackbacks/40435.html      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



freefly 2006-04-11 12:41 發(fā)表評論
]]>
solution for mess code in struts+spring+hibernate+mysql4.1 http://m.tkk7.com/freefly/archive/2006/03/23/37026.htmlfreeflyfreeflyThu, 23 Mar 2006 05:07:00 GMThttp://m.tkk7.com/freefly/archive/2006/03/23/37026.htmlhttp://m.tkk7.com/freefly/comments/37026.htmlhttp://m.tkk7.com/freefly/archive/2006/03/23/37026.html#Feedback0http://m.tkk7.com/freefly/comments/commentRss/37026.htmlhttp://m.tkk7.com/freefly/services/trackbacks/37026.html Here is my solution for  mess code on page,hope this can help you!
 The point is your database coding should be consistent with the coding of  character that you plan to insert into the database.
 Attention: Here,I take "UTF-8" as default character coding way .
 There are three steps:
 1. set page charset 
     e.g      <%@ page language="java" contentType="text/html; charset=UTF-8" %>
    
 2. create character filter:
     package com.victory.util;

     import javax.servlet.http.HttpServlet;
     import javax.servlet.Filter;
     import javax.servlet.FilterConfig;
     import javax.servlet.ServletException;
     import javax.servlet.ServletRequest;
     import javax.servlet.ServletResponse;
     import javax.servlet.FilterChain;
     import javax.servlet.http.*;
     import java.io.IOException;
     public class CharacterEncodingFilter
       extends HttpServlet
       implements Filter {

       private FilterConfig filterConfig;
       private String targetEncoding = "ASCII";

     /**
      * Called by the web container to indicate to a filter that it is being placed
      * into service.
      *
      * @param filterConfig FilterConfig
      * @throws ServletException
      * @todo Implement this javax.servlet.Filter method
     */
      public void init(FilterConfig filterConfig) throws ServletException {
      this.filterConfig = filterConfig;
      this.targetEncoding = filterConfig.getInitParameter("encoding");
     }

    /**
     * The <code>doFilter</code> method of the Filter is called by the container
     * each time a request/response pair is passed through the chain due to a
     * client request for a resource at the end of the chain.
     *
     * @param request ServletRequest
     * @param response ServletResponse
     * @param chain FilterChain
     * @throws IOException
     * @throws ServletException
     * @todo Implement this javax.servlet.Filter method
     */
     public void doFilter(ServletRequest srequest, ServletResponse sresponse,
                       FilterChain chain) throws IOException, ServletException {
      try {
        HttpServletRequest request = (HttpServletRequest) srequest;
        request.setCharacterEncoding(targetEncoding);
        chain.doFilter(srequest, sresponse);
          }
      catch (ServletException sx) {
         filterConfig.getServletContext().log(sx.getMessage());
          }
      catch (IOException iox) {
         filterConfig.getServletContext().log(iox.getMessage());
        }
      }

    /**
     * Called by the web container to indicate to a filter that it is being taken
     * out of service.
     *
     * @todo Implement this javax.servlet.Filter method
     */
     public void destroy() {
       filterConfig = null;
       targetEncoding = null;
     }
  }
  
  3.config web.xml
    attention: add these to your web.xml
     <filter>
     <filter-name>EncodingFilter</filter-name>
     <filter-class>com.victory.util.CharacterEncodingFilter</filter-class>
     <init-param>
       <param-name>encoding</param-name>
       <param-value>UTF-8</param-value>
     </init-param>
    </filter>
    <filter-mapping>
    <filter-name>EncodingFilter</filter-name>
     <url-pattern>/*</url-pattern>
    </filter-mapping> 
  4.set database configration
     modify the file:    my.ini
     [client]     default-character-set=utf8 
     [mysqld]  default-character-set=utf8
  5.restart Mysql server
  6.modified your table coding way to utf8

     or ceate your table like this :
     CREATE TABLE `user` (
    `ID` int(11) NOT NULL auto_increment,
    `USERNAME` varchar(50) NOT NULL default '',
    `PASSWORD` varchar(50) NOT NULL default '',
     PRIMARY KEY  (`ID`)
     ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
  7.restrart your tomcat sever

   OK,it's all.

   Authrougn I have sovled   my problem, I think I  don't have enough understanding for it,  So hope    communicate with you! 

   Attention:mess code also exist in your database,through page hasn't mess code.
   
     


   
  
       
     



freefly 2006-03-23 13:07 發(fā)表評論
]]>
主站蜘蛛池模板: 国产亚洲成av片在线观看| 无人在线直播免费观看| 国产精品99久久免费| 亚洲精品一二三区| 无人影院手机版在线观看免费| 亚洲va精品中文字幕| a毛片基地免费全部视频| 亚洲性一级理论片在线观看| 国产大片91精品免费观看不卡| 67pao强力打造67194在线午夜亚洲| 99精品国产成人a∨免费看| 亚洲视频在线观看免费视频| 亚洲国产精品免费在线观看| 亚洲av无码一区二区三区天堂古代| 欧洲乱码伦视频免费| 亚洲AV成人片无码网站| yy6080亚洲一级理论| 久久99免费视频| 亚洲精品午夜视频| 思思99re66在线精品免费观看| 免费无码午夜福利片| 亚洲av无码乱码国产精品fc2| 99精品在线免费观看| 亚洲熟伦熟女专区hd高清| 国产成人无码区免费A∨视频网站| 黄色一级视频免费观看| 亚洲精品乱码久久久久久按摩 | 好紧我太爽了视频免费国产| 亚洲视频在线视频| 成年女人18级毛片毛片免费 | 国产免费不卡v片在线观看 | 黄桃AV无码免费一区二区三区| 亚洲成AV人片在| 免费中文熟妇在线影片| 美女羞羞喷液视频免费| 亚洲AV无码一区二区二三区入口| 性一交一乱一视频免费看| 中文字幕无码免费久久9一区9 | 国产成人亚洲精品91专区高清| 狠狠综合久久综合88亚洲| 国产成人免费在线|