freefly
          一門技術,如果不能講出來,那么就是沒有理解,如果不能很好的講出來,那么就是理解不夠透徹!
          posts - 9,comments - 3,trackbacks - 0
          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

                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 on 2006-04-11 12:41 freefly 閱讀(367) 評論(0)  編輯  收藏 所屬分類: Hibernate

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 蚌埠市| 丰县| 县级市| 宝清县| 金门县| 孙吴县| 榆林市| 澜沧| 分宜县| 云南省| 临江市| 新邵县| 黔东| 乐陵市| 大悟县| 乐昌市| 平邑县| 喜德县| 绵阳市| 卢氏县| 宜昌市| 乐安县| 民县| 客服| 永兴县| 犍为县| 仁化县| 琼中| 安陆市| 张家口市| 安多县| 沁阳市| 台中市| 开江县| 太仓市| 溆浦县| 梁平县| 潞城市| 潜山县| 咸宁市| 汉寿县|