avtt亚洲天堂,97se亚洲国产综合自在线 ,伊人久久亚洲综合影院http://www.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://www.tkk7.com/freefly/archive/2006/04/11/40435.htmlfreeflyfreeflyTue, 11 Apr 2006 04:41:00 GMThttp://www.tkk7.com/freefly/archive/2006/04/11/40435.htmlhttp://www.tkk7.com/freefly/comments/40435.htmlhttp://www.tkk7.com/freefly/archive/2006/04/11/40435.html#Feedback0http://www.tkk7.com/freefly/comments/commentRss/40435.htmlhttp://www.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://www.tkk7.com/freefly/archive/2006/03/23/37026.htmlfreeflyfreeflyThu, 23 Mar 2006 05:07:00 GMThttp://www.tkk7.com/freefly/archive/2006/03/23/37026.htmlhttp://www.tkk7.com/freefly/comments/37026.htmlhttp://www.tkk7.com/freefly/archive/2006/03/23/37026.html#Feedback0http://www.tkk7.com/freefly/comments/commentRss/37026.htmlhttp://www.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无码免费看永久| 亚洲精品线在线观看| 日韩免费一区二区三区在线播放| 男男gay做爽爽免费视频| 亚洲乱人伦精品图片| 97久久精品亚洲中文字幕无码| 亚洲日韩久久综合中文字幕| 久久噜噜噜久久亚洲va久| h片在线免费观看| 国产成人亚洲精品播放器下载 | 亚洲深深色噜噜狠狠网站| 免费观看理论片毛片| 国产精品福利在线观看免费不卡| 无码欧精品亚洲日韩一区| 亚洲一区视频在线播放| 精品国产污污免费网站aⅴ| a级毛片免费在线观看| 亚洲熟妇AV日韩熟妇在线| 国产亚洲高清不卡在线观看| 免费大黄网站在线看| 120秒男女动态视频免费| 日韩免费的视频在线观看香蕉| a级成人毛片免费图片| 久久www免费人成看国产片| 亚洲美国产亚洲AV| 最新国产精品亚洲| 亚洲中文字幕无码久久2020 | 88xx成人永久免费观看| 久草免费福利视频| 美女视频黄频a免费大全视频| 亚洲尹人九九大色香蕉网站| 亚洲日韩人妻第一页| 一本久久综合亚洲鲁鲁五月天| 一区二区三区亚洲视频| 国产成人毛片亚洲精品| 亚洲老妈激情一区二区三区| 国产亚洲婷婷香蕉久久精品 | 中国毛片免费观看| 免费观看久久精彩视频 | 亚洲国产日韩在线人成下载| 亚洲一级免费视频|