- 浏览: 597548 次
- 性别:
- 来自: 杭州
最新评论
-
tylerren:
stauts : 9 返回值是9,有遇到的吗?
CMPP3.0 CMPP2.0 java实现 -
tengdong:
2019-02-26 10:47:30,231 INFO Ms ...
CMPP3.0 CMPP2.0 java实现 -
secjy:
cmpp2 发送之后 ,提示发送成功,但是手机接收不到短信。c ...
CMPP3.0 CMPP2.0 java实现 -
西瓜xg:
2017-05-18 12:05:59,222 INFO Ms ...
CMPP3.0 CMPP2.0 java实现 -
贝塔ZQ:
Java实现读取excel文件到数据库中,也可以使用插件实现的 ...
使用Java读取Excel文件内容 excel导入sql
今日早上发了个贴子,现在终于有了一套方案,原贴如下:
DEBUG 2009-03-07 09:49:20,757 | [com.hzjava.xiu.site.web.servlet.MatchAutoServlet]:init | ========MatchAutoServlet启动======== INFO 2009-03-07 09:49:20,835 | [com.hzjava.xiu.site.web.servlet.MatchAutoServlet]:init | ====spring上下文获得成功==== Hibernate: select this_.ID as ID13_0_, this_.NAME as NAME13_0_, this_.KEY_CODE as KEY3_13_0_, this_.price as price13_0_ from ST_SERVICE_PRICE this_ DEBUG 2009-03-07 09:49:20,882 | [com.hzjava.xiu.site.service.ServicePriceServiceImpl]:getSPriceList | 系统服务定价DB同步:3 DEBUG 2009-03-07 09:49:20,882 | [com.hzjava.xiu.site.service.ServicePriceServiceImpl]:getSPriceList | 0.0 DEBUG 2009-03-07 09:49:20,913 | [com.hzjava.xiu.site.web.servlet.MatchAutoServlet$MatchAutoThread]:run | ========系统自动匹配供求信息Start;60*5秒运行一次======== Hibernate: select top 10000 supplyinfo0_.ID as ID6_, supplyinfo0_.userId as userId6_, supplyinfo0_.productId as productId6_, supplyinfo0_.TYPE_ID as TYPE4_6_, supplyinfo0_.billDesc as billDesc6_, supplyinfo0_.kindId as kindId6_, supplyinfo0_.cityId as cityId6_, supplyinfo0_.pic as pic6_, supplyinfo0_.price as price6_, supplyinfo0_.amount as amount6_, supplyinfo0_.yue_lilv as yue11_6_, supplyinfo0_.pubTime as pubTime6_, supplyinfo0_.endTime as endTime6_, supplyinfo0_.IS_Dirty as IS14_6_, supplyinfo0_.O_CONTACT_WAY as O15_6_, supplyinfo0_.qipiaoId as qipiaoId6_, supplyinfo0_.danbiId as danbiId6_, supplyinfo0_.infostateId as infosta18_6_, supplyinfo0_.createTime as createTime6_, supplyinfo0_.releaseTime as release20_6_ from sv_SupplyInfo supplyinfo0_ where 1=1 and supplyinfo0_.infostateId=? and supplyinfo0_.TYPE_ID=? order by supplyinfo0_.ID desc ERROR 2009-03-07 09:49:20,944 | [org.hibernate.util.JDBCExceptionReporter]:logExceptions | No data found Exception in thread "Thread-5" org.hibernate.exception.GenericJDBCException: could not execute query at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2214) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095) at org.hibernate.loader.Loader.list(Loader.java:2090) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at cn.collin.commons.dao.MyDaoSupport.findByMaxResults(MyDaoSupport.java:274) at com.hzjava.xiu.site.dao.SupplyDAOImpl.listByMaxResults(SupplyDAOImpl.java:79) at com.hzjava.xiu.site.service.SupplyServiceImpl.newMatchAuto(SupplyServiceImpl.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy5.newMatchAuto(Unknown Source) at com.hzjava.xiu.site.web.servlet.MatchAutoServlet$MatchAutoThread.run(MatchAutoServlet.java:57) Caused by: java.sql.SQLException: No data found at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7139) at sun.jdbc.odbc.JdbcOdbc.SQLGetDataDouble(JdbcOdbc.java:3658) at sun.jdbc.odbc.JdbcOdbcResultSet.getDataDouble(JdbcOdbcResultSet.java:5576) at sun.jdbc.odbc.JdbcOdbcResultSet.getLong(JdbcOdbcResultSet.java:632) at sun.jdbc.odbc.JdbcOdbcResultSet.getLong(JdbcOdbcResultSet.java:650) at org.apache.commons.dbcp.DelegatingResultSet.getLong(DelegatingResultSet.java:240) at org.hibernate.type.LongType.get(LongType.java:28) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102) at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81) at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2046) at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1371) at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1299) at org.hibernate.loader.Loader.getRow(Loader.java:1197) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568) at org.hibernate.loader.Loader.doQuery(Loader.java:689) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2211)
因为一直使用的是Mysql.现在做了个网站因为客户端软件采用C#开发的,所以为了配合软件数据库采用SQLSERVER。而昨天采用jdbc直连的方式没有成功【数据库已连接,但查询不出数据,SP4补丁已打!Jar包已有!】
先看看ODBC的配置文件吧
#-----------ODBC------ jdbc.driverClassName=sun.jdbc.odbc.JdbcOdbcDriver jdbc.url=jdbc:odbc:supply jdbc.password=123456 jdbc.username=sa jdbc.initialSize=1 jdbc.maxActive=20 jdbc.maxIdle=10 jdbc.maxWait=120000 hibernate.dialect=org.hibernate.dialect.SQLServerDialect hibernate.show_sql=true hibernate.jdbc.batch_size=20 hibernate.connection.pool_size=20
这个不用说了,ODBC数据源建了的,ODBC是连接成功了的。
在这一步可以看出:
DEBUG 2009-03-07 09:49:20,882 | [com.hzjava.xiu.site.service.ServicePriceServiceImpl]:getSPriceList | 系统服务定价DB同步:3 DEBUG 2009-03-07 09:49:20,882 | [com.hzjava.xiu.site.service.ServicePriceServiceImpl]:getSPriceList | 0.0
做DB同步时查询出来的LIST为3!说明连接成功了并且执行错误了。
这个JDBC的错误我看懂了,就是说Hibernate在做ORM的时候,因为我查询的这张表里存在NULL的数据,而HIBERNATE在rs那里采用rs.getLong()等等的时候就报错了。
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataDouble(JdbcOdbcResultSet.java:5576) at sun.jdbc.odbc.JdbcOdbcResultSet.getLong(JdbcOdbcResultSet.java:632) at sun.jdbc.odbc.JdbcOdbcResultSet.getLong(JdbcOdbcResultSet.java:650) at org.apache.commons.dbcp.DelegatingResultSet.getLong(DelegatingResultSet.java:240) at org.hibernate.type.LongType.get(LongType.java:28) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
我的查询语句没有问题,全都是HIBERNATE方言生成,我拿到数据库去执行了一次,能够得出正确的结果。问题就是,
rs.getLong("cityId"),比如cityId这一列在数据库中为NULL,这样的写法就会导致SQL异常么?如果是这样,那Hibernate怎么解决这个问题呢?因为做ORM映射肯定是要每个列都要GET的。。。
!谢谢!
另外JDBC直连的方式DB同步的时候结果为0,查询不出任何数据,任何表都一样。我不知道为什么。。。
SPRING配置文件没有问题的,部分代码
<!-- datasource --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>${jdbc.driverClassName}</value> </property> <property name="url"> <value>${jdbc.url}</value> </property> <property name="username"> <value>${jdbc.username}</value> </property> <property name="password"> <value>${jdbc.password}</value> </property> <property name="initialSize"> <value>${jdbc.initialSize}</value> </property> <property name="maxActive"> <value>${jdbc.maxActive}</value> </property> <property name="maxIdle"> <value>${jdbc.maxIdle}</value> </property> <property name="maxWait"> <value>${jdbc.maxWait}</value> </property> </bean>
CONFIG文件:
#-----------SQLSERVER------ jdbc.driverClassName=com.microsoft.jdbc.sqlserver.SQLServerDriver jdbc.url=jdbc:sqlserver://localhost:1433;databseName=supply?useUnicode=true&characterEncoding=UTF-8&serverTimezone=+00:00&autoReconnect=true&autoReconnectForPools=true jdbc.password=123456 jdbc.username=sa jdbc.initialSize=1 jdbc.maxActive=20 jdbc.maxIdle=10 jdbc.maxWait=120000 hibernate.dialect=org.hibernate.dialect.SQLServerDialect hibernate.show_sql=true hibernate.jdbc.batch_size=20 hibernate.connection.pool_size=20
SP4已打,三个JAR包已有。在线&等!!!感谢!!!
以上为上午所发的贴子。。
晚上逛论坛的收获:
http://www.iteye.com/topic/7407
??? 其实发现微软驱动的不足,也是很偶然的机会。在一次移植应用中,系统报告了[Microsoft][SQLServer JDBC Driver]ResultSet can not re-read row data for column之类的错误。为了解决这个错误,跟踪程序忙了大半天,也没有查出问题所在。只能确定在在rs.getString("XXX")的时候必然会出现错误(rs为ResultSet对象)。那么现在就模拟以下当时的环境:
??? 数据库表:TestTable
??? 表字段及类型:
???????? guid char(38)
???????? title varchar(100)
???????? content Text
???????? username varchar(20)
??? 查询sql语句:
???????? select guid,username,content,title from TestTable where····
??? java代码:
???????? rs.getString("guid");
???????? rs.getBinaryStream("content");
???????? rs.getString("username");
??? -----------------------------------------------------------
??? 上面那段代码,很不荣幸是。使用微软的驱动,必然会报错(就是上面说的那个错误)。如果你跟踪的话,必然是这一行:rs.getString("username")抛出错误。
??? 那么,如果你把rs.getString("username")和rs.getBinaryStream("content");位置互换以下,会怎么样呢。结果就是可以正常运行。
??? 为什么会出现这种情况呢,因为微软的驱动,在包含了blob或clob类型(就是Image和Text类型)的字段。那么就必须按照select顺序查询,且不支持重复查询。
?? 面对这种情况,只有更换驱动了。国外第三方的驱动很多,比如JSQLConnect,JTurbo等等。这些都是商用的,需要付费,不够有试用版本。如果希望有个免费的,可以在www.freetds.com上获取一个免费的(我没有测试过这个免费驱动,不知道是否会存在这种情况)。
?
有关最初的说明,可以参考[javasearch]
http://www.javaresearch.org/article/showarticle.jsp?column=2&thread=4278]
或[javaunion](很遗憾的是,javaunion已经不存在了)
http://www.javaunion.org/bbs/cgi-bin/topic.cgi?forum=1&topic=15516&show=0
??? 其实今天想说的这篇文档真的有些老了。早在曾经的javaunion还存在的时候就谈过这样的问题了。今天突然又贴出来,只是偶然间发现了数据库板块中的 “SQLServer2000 JDBC驱动的完整安装及测试说明”这篇文档。我以为会有些什么值得参考的东东,结果大失所望(文章很适合入门型的参考,从这一点上写的还是可以的)。不过,拿来商业性应用中,就有些幼稚了。
??? 希望大家慎用或尽量不要用微软自带的sqlserver的jdbc驱动。
??? 如果有什么疑问,或有错误地方,请斧正。可以发邮件,相互交流。
作者:银狐999(james999)
信箱:james-fly@vip.sina.com
===============================================
接受blundblade兄弟的建议,补充如下:
(1)如果采用jdbc-odbc驱动,那么就必须按照查询顺序来一次读取(不论有没有image或text类型)
(2)如果采用微软提供的ms sql server jdbc driver,如果查询语句中,不存在image或text类型字段,那么可以按照无序获取
(3)如果采用微软提供的ms sql server jdbc driver,如果查询语句中,存在image或text类型字段,那么就必须按照顺序读取,否则就会报告Driver]ResultSet can not re-read row data for column之类的错误
(4)如果想不查询语句中有没有image或text类型字段,都可以不按照顺序获取,或重复获取。那么就必须更换驱动,改用第三方的。
楼主主要是涉及到两表联立查询了 所以单个查询即可
只是把一条SQL拆成两条了 没办法 B4微软吧
需要在connection url后面加上SelectMethod=cursor
可以解决re-read的问题.
但是还是不推荐使用这个性能糟糕的driver,
使用jtds吧, pass all hibernate test case, open source:
http://sourceforge.net/projects/jtds/
感谢readonly给出的建议,我到jtds的官网浏览并下载了jtds,看了下文档,下面说下我的配置步骤【hibernate测试通过】
首先下载jtds,然后将jtds-1.2.2.jar复制到lib目录下,
接着-》config.properties:
#-----------SQLSERVER------ jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver jdbc.url=jdbc:jtds:sqlserver://ipaddress:1433/supply jdbc.password=password jdbc.username=sa jdbc.initialSize=1 jdbc.maxActive=20 jdbc.maxIdle=10 jdbc.maxWait=120000 hibernate.dialect=org.hibernate.dialect.SQLServerDialect hibernate.show_sql=true hibernate.jdbc.batch_size=20 hibernate.connection.pool_size=20
密码和ip请根据自己的设置更改。
测试成功,console显示:
Hibernate: select banks0_.SUPPLY_ID as SUPPLY3_1_, banks0_.ID as ID1_, banks0_.ID as ID5_0_, banks0_.BANK_ID as BANK2_5_0_, banks0_.SUPPLY_ID as SUPPLY3_5_0_, banks0_.MAIDUAN as MAIDUAN5_0_, banks0_.HUIGOU as HUIGOU5_0_ from st_BANK banks0_ where banks0_.SUPPLY_ID=? Hibernate: select top 10000 supplyinfo0_.ID as ID6_, supplyinfo0_.userId as userId6_, supplyinfo0_.productId as productId6_, supplyinfo0_.TYPE_ID as TYPE4_6_, supplyinfo0_.billDesc as billDesc6_, supplyinfo0_.kindId as kindId6_, supplyinfo0_.cityId as cityId6_, supplyinfo0_.pic as pic6_, supplyinfo0_.price as price6_, supplyinfo0_.amount as amount6_, supplyinfo0_.yue_lilv as yue11_6_, supplyinfo0_.pubTime as pubTime6_, supplyinfo0_.endTime as endTime6_, supplyinfo0_.IS_Dirty as IS14_6_, supplyinfo0_.O_CONTACT_WAY as O15_6_, supplyinfo0_.qipiaoId as qipiaoId6_, supplyinfo0_.danbiId as danbiId6_, supplyinfo0_.infostateId as infosta18_6_, supplyinfo0_.createTime as createTime6_, supplyinfo0_.releaseTime as release20_6_ from sv_SupplyInfo supplyinfo0_ where 1=1 and supplyinfo0_.TYPE_ID=? and supplyinfo0_.infostateId=? and supplyinfo0_.productId=? and supplyinfo0_.yue_lilv>=? order by supplyinfo0_.ID desc Hibernate: select banks0_.SUPPLY_ID as SUPPLY3_1_, banks0_.ID as ID1_, banks0_.ID as ID5_0_, banks0_.BANK_ID as BANK2_5_0_, banks0_.SUPPLY_ID as SUPPLY3_5_0_, banks0_.MAIDUAN as MAIDUAN5_0_, banks0_.HUIGOU as HUIGOU5_0_ from st_BANK banks0_ where banks0_.SUPPLY_ID=? Hibernate: select count(*) as col_0_0_ from ST_MATCH match0_ where 1=1 and match0_.SELL_ID=? and match0_.BUY_ID=? DEBUG 2009-03-07 23:49:09,375 | [org.hibernate.cache.UpdateTimestampsCache]:preinvalidate | Pre-invalidating space [ST_MATCH] Hibernate: insert into ST_MATCH (SELL_ID, BUY_ID, STATE_ID, CREATED_TIME) values (?, ?, ?, ?) DEBUG 2009-03-07 23:49:09,781 | [com.hzjava.xiu.site.service.SupplyServiceImpl]:newMatchAuto | =========共匹配到1信息======== DEBUG 2009-03-07 23:49:09,875 | [org.hibernate.cache.UpdateTimestampsCache]:invalidate | Invalidating space [ST_MATCH], timestamp: 5064462130688000 DEBUG 2009-03-07 23:49:46,812 | [com.hzjava.wibo.site.service.HierInfoService]:findHierInfo | SV_ZX_BOOKING_CHARGE_DAY:id = 15000 DEBUG 2009-03-07 23:49:46,812 | [com.hzjava.wibo.site.service.HierInfoService]:findHierInfo | SV_ZX_BOOKING_CHARGE_DAY:id = 15000 DEBUG 2009-03-07 23:54:09,875 | [com.hzjava.xiu.site.web.servlet.MatchAutoServlet$MatchAutoThread]:run | ========系统自动匹配供求信息Start;60*5秒运行一次======== Hibernate: select top 10000 supplyinfo0_.ID as ID6_, supplyinfo0_.userId as userId6_, supplyinfo0_.productId as productId6_, supplyinfo0_.TYPE_ID as TYPE4_6_, supplyinfo0_.billDesc as billDesc6_, supplyinfo0_.kindId as kindId6_, supplyinfo0_.cityId as cityId6_, supplyinfo0_.pic as pic6_, supplyinfo0_.price as price6_, supplyinfo0_.amount as amount6_, supplyinfo0_.yue_lilv as yue11_6_, supplyinfo0_.pubTime as pubTime6_, supplyinfo0_.endTime as endTime6_, supplyinfo0_.IS_Dirty as IS14_6_, supplyinfo0_.O_CONTACT_WAY as O15_6_, supplyinfo0_.qipiaoId as qipiaoId6_, supplyinfo0_.danbiId as danbiId6_, supplyinfo0_.infostateId as infosta18_6_, supplyinfo0_.createTime as createTime6_, supplyinfo0_.releaseTime as release20_6_ from sv_SupplyInfo supplyinfo0_ where 1=1 and supplyinfo0_.infostateId=? and supplyinfo0_.TYPE_ID=? order by supplyinfo0_.ID desc Hibernate: select banks0_.SUPPLY_ID as SUPPLY3_1_, banks0_.ID as ID1_, banks0_.ID as ID5_0_, banks0_.BANK_ID as BANK2_5_0_, banks0_.SUPPLY_ID as SUPPLY3_5_0_, banks0_.MAIDUAN as MAIDUAN5_0_, banks0_.HUIGOU as HUIGOU5_0_ from st_BANK banks0_ where banks0_.SUPPLY_ID=? Hibernate: select top 10000 supplyinfo0_.ID as ID6_, supplyinfo0_.userId as userId6_, supplyinfo0_.productId as productId6_, supplyinfo0_.TYPE_ID as TYPE4_6_, supplyinfo0_.billDesc as billDesc6_, supplyinfo0_.kindId as kindId6_, supplyinfo0_.cityId as cityId6_, supplyinfo0_.pic as pic6_, supplyinfo0_.price as price6_, supplyinfo0_.amount as amount6_, supplyinfo0_.yue_lilv as yue11_6_, supplyinfo0_.pubTime as pubTime6_, supplyinfo0_.endTime as endTime6_, supplyinfo0_.IS_Dirty as IS14_6_, supplyinfo0_.O_CONTACT_WAY as O15_6_, supplyinfo0_.qipiaoId as qipiaoId6_, supplyinfo0_.danbiId as danbiId6_, supplyinfo0_.infostateId as infosta18_6_, supplyinfo0_.createTime as createTime6_, supplyinfo0_.releaseTime as release20_6_ from sv_SupplyInfo supplyinfo0_ where 1=1 and supplyinfo0_.TYPE_ID=? and supplyinfo0_.infostateId=? and supplyinfo0_.productId=? and supplyinfo0_.yue_lilv>=? order by supplyinfo0_.ID desc Hibernate: select banks0_.SUPPLY_ID as SUPPLY3_1_, banks0_.ID as ID1_, banks0_.ID as ID5_0_, banks0_.BANK_ID as BANK2_5_0_, banks0_.SUPPLY_ID as SUPPLY3_5_0_, banks0_.MAIDUAN as MAIDUAN5_0_, banks0_.HUIGOU as HUIGOU5_0_ from st_BANK banks0_ where banks0_.SUPPLY_ID=? Hibernate: select count(*) as col_0_0_ from ST_MATCH match0_ where 1=1 and match0_.SELL_ID=? and match0_.BUY_ID=? DEBUG 2009-03-07 23:54:15,156 | [com.hzjava.xiu.site.service.SupplyServiceImpl]:newMatchAuto | =========匹配结果已存在======== DEBUG 2009-03-07 23:54:15,156 | [com.hzjava.xiu.site.service.SupplyServiceImpl]:newMatchAuto | =========共匹配到0信息======== DEBUG 2009-03-07 23:59:16,250 | [com.hzjava.xiu.site.web.servlet.MatchAutoServlet$MatchAutoThread]:run | ========系统自动匹配供求信息Start;60*5秒运行一次======== Hibernate: select top 10000 supplyinfo0_.ID as ID6_, supplyinfo0_.userId as userId6_, supplyinfo0_.productId as productId6_, supplyinfo0_.TYPE_ID as TYPE4_6_, supplyinfo0_.billDesc as billDesc6_, supplyinfo0_.kindId as kindId6_, supplyinfo0_.cityId as cityId6_, supplyinfo0_.pic as pic6_, supplyinfo0_.price as price6_, supplyinfo0_.amount as amount6_, supplyinfo0_.yue_lilv as yue11_6_, supplyinfo0_.pubTime as pubTime6_, supplyinfo0_.endTime as endTime6_, supplyinfo0_.IS_Dirty as IS14_6_, supplyinfo0_.O_CONTACT_WAY as O15_6_, supplyinfo0_.qipiaoId as qipiaoId6_, supplyinfo0_.danbiId as danbiId6_, supplyinfo0_.infostateId as infosta18_6_, supplyinfo0_.createTime as createTime6_, supplyinfo0_.releaseTime as release20_6_ from sv_SupplyInfo supplyinfo0_ where 1=1 and supplyinfo0_.infostateId=? and supplyinfo0_.TYPE_ID=? order by supplyinfo0_.ID desc Hibernate: select banks0_.SUPPLY_ID as SUPPLY3_1_, banks0_.ID as ID1_, banks0_.ID as ID5_0_, banks0_.BANK_ID as BANK2_5_0_, banks0_.SUPPLY_ID as SUPPLY3_5_0_, banks0_.MAIDUAN as MAIDUAN5_0_, banks0_.HUIGOU as HUIGOU5_0_ from st_BANK banks0_ where banks0_.SUPPLY_ID=? Hibernate: select top 10000 supplyinfo0_.ID as ID6_, supplyinfo0_.userId as userId6_, supplyinfo0_.productId as productId6_, supplyinfo0_.TYPE_ID as TYPE4_6_, supplyinfo0_.billDesc as billDesc6_, supplyinfo0_.kindId as kindId6_, supplyinfo0_.cityId as cityId6_, supplyinfo0_.pic as pic6_, supplyinfo0_.price as price6_, supplyinfo0_.amount as amount6_, supplyinfo0_.yue_lilv as yue11_6_, supplyinfo0_.pubTime as pubTime6_, supplyinfo0_.endTime as endTime6_, supplyinfo0_.IS_Dirty as IS14_6_, supplyinfo0_.O_CONTACT_WAY as O15_6_, supplyinfo0_.qipiaoId as qipiaoId6_, supplyinfo0_.danbiId as danbiId6_, supplyinfo0_.infostateId as infosta18_6_, supplyinfo0_.createTime as createTime6_, supplyinfo0_.releaseTime as release20_6_ from sv_SupplyInfo supplyinfo0_ where 1=1 and supplyinfo0_.TYPE_ID=? and supplyinfo0_.infostateId=? and supplyinfo0_.productId=? and supplyinfo0_.yue_lilv>=? order by supplyinfo0_.ID desc Hibernate: select banks0_.SUPPLY_ID as SUPPLY3_1_, banks0_.ID as ID1_, banks0_.ID as ID5_0_, banks0_.BANK_ID as BANK2_5_0_, banks0_.SUPPLY_ID as SUPPLY3_5_0_, banks0_.MAIDUAN as MAIDUAN5_0_, banks0_.HUIGOU as HUIGOU5_0_ from st_BANK banks0_ where banks0_.SUPPLY_ID=? Hibernate: select count(*) as col_0_0_ from ST_MATCH match0_ where 1=1 and match0_.SELL_ID=? and match0_.BUY_ID=? DEBUG 2009-03-07 23:59:16,828 | [com.hzjava.xiu.site.service.SupplyServiceImpl]:newMatchAuto | =========匹配结果已存在======== DEBUG 2009-03-07 23:59:16,828 | [com.hzjava.xiu.site.service.SupplyServiceImpl]:newMatchAuto | =========共匹配到0信息========
看来jtds的确是个好东东···呵呵。如果有用的朋友希望可以一起交流。
最后,如果你觉得本文对你有帮助,请别吝啬您的文字,本人保证以上所有代码都为真实测试,如有遗漏,忘请指正!
发表评论
-
使用httpclient返回 header too long
2017-07-14 17:14 1874最近些的爬虫请求某代理网站时运行几天就会持续报错4 ... -
Java通过浏览器请求头(UserAgent)获取手机机型
2014-09-20 15:38 27164方案一:正则表达式 通过观察规律,得出以下表达式: ; ... -
TOMCAT7 生产环境优化
2014-05-28 16:33 26850TOMCAT的优化基本分为两 ... -
CMPP3.0 CMPP2.0 java实现
2013-05-13 11:49 33523实现了连接、短信收发、webpush,支持长短信。 ... -
nginx配置
2013-02-27 13:22 1265#user nobody; worker_proc ... -
java从apk文件里获取包名、版本号
2012-12-11 15:36 25893测试代码: package org.apkinfo.t ... -
java 进阶(持续补充)
2012-10-11 14:52 740JDK1.5新增特性 枚举、泛型、可变参数、注 ... -
[非常简单]Linux下启动java程序的通用脚本sh(可用作开机启动service脚本)
2011-11-07 09:24 17743如果未设置JAVA_HOME环境变量,需要手动指定 #JDK ... -
2年经验面试复习大纲【欢迎补充】
2011-05-18 17:02 2029前言: 由于最近换工作,需要面试,为了加深自己复习的印象,同 ... -
Twitter从Rails迁移到了Java
2011-04-25 09:00 20Rail那插满五颜六色鲜艳羽毛的帽子现在跌落到了地上 ... -
一个工作了快两年的Java Coder的迷惑
2011-04-19 15:05 0时间一转眼就快2年了,首先介绍一下我自己,我不是计算机专业的, ... -
Linux shell语法小结
2011-04-11 15:03 52101、 set命令 当没有参数的时候,列出系统中 ... -
WindowsXP下通过硬盘安装Ubuntu实现双系统2种方法对比分析
2011-04-01 15:11 6595首先是一种适合新手的方法,这种方法把Ubuntu当作一个软件安 ... -
Linux下的CVS权限配置
2011-03-31 15:56 2447虽然SVN现在已经是主流,但CVS仍然是很多公司的选择,由于考 ... -
linux mysql安装
2011-02-21 08:44 34301、解压安装包 #tar zxvf m ... -
【诡异问题系列】LINUX TOMCAT能连上MYSQL 但查询不出数据
2010-11-03 14:31 98jdk->tomcat->mysql 都配置好了后 ... -
刨根问底session
2010-06-29 15:10 2492摘要:虽然session机 ... -
jquery ajax 跨域解决方案【1分钟】
2010-06-08 10:53 2798背景,由于登录服务器和应用服务器不在一个域,所以必须跨域进行登 ... -
String StringBuffer StringBuilder
2010-05-31 15:56 1240这篇文章讲的很好,推荐下: 三分钟理解Java中字符串(Str ... -
JavaScript 深入学习 笔记
2010-01-07 13:18 1440本文主要记录一些JavaScript的比较值得注意的特性。 ...
相关推荐
总的来说,"SpringBoot+Hibernate+MySQL+SQLServer双数据源"项目展示了如何在Java环境中灵活处理多数据库的需求,为复杂的企业级应用提供了可靠的解决方案。通过理解并掌握这些技术,开发者可以提升自己的技能,应对...
解决方案** 针对出现的连接重置问题,可以通过以下方式来解决: - **设置自动提交模式**:默认情况下,Hibernate会将所有事务设置为非自动提交模式。对于SQL Server 2000来说,在非自动提交模式下,每次执行查询...
本文将深入探讨标题和描述中提到的“com.microsoft.sqlserver.jdbc.SQLServerException: 只进结果集不支持请求的操作”这一异常,以及如何在使用Hibernate、Struts进行分页时避免这一问题。我们将从异常的根本原因...
在这个案例中,SSH2与SQL Server2008数据库结合,提供了完整的MVC(模型-视图-控制器)架构和数据持久化解决方案。 Struts2作为MVC框架的一部分,负责处理HTTP请求和控制应用程序流程。它通过Action类和配置文件...
SQL Server 2000 JDBC驱动属于Type 2,它结合了Java和数据库特定的API,提供了一个混合的纯Java和本地代码的解决方案。这种类型的驱动通常比Type 1(纯Java驱动)性能更好,但不如Type 4(完全基于Java的驱动)跨...
1. **连接SQLServer2012**: - 首先,确保你的系统已经安装了JDBC驱动(Microsoft SQL JDBC Driver)。可以在微软官方网站下载并添加到Eclipse的类路径中。 - 在JSP文件中,使用Java的`Class.forName()`方法加载...
标题中的"SSH2+JQUERY+ajax+sqlserver数据库"是一个综合性的技术组合,涉及到Web开发的多个层面,包括服务器端、客户端以及数据存储。让我们逐一解析这些技术及其在实际应用中的作用。 **SSH2(Struts2 + Spring + ...
3. **JDBC**:Java Database Connectivity (JDBC) 是Java连接Sql Server数据库的主要方式,通过JDBC驱动,程序可以进行数据的增删改查操作。 4. **Spring框架**:可能采用了Spring框架来管理依赖关系,提供事务控制...
本系统基于Java编程语言与SQL Server数据库,构建了一套完整的图书借阅管理解决方案。Java以其强大的跨平台能力和丰富的类库,成为开发此类系统的理想选择;而SQL Server作为企业级的关系型数据库管理系统,能够确保...
6. **Oracle转换到SQL Server 2000注意事项** - 这种转换可能涉及到数据类型、SQL语法、存储过程、触发器等的差异。在迁移过程中,需要对表结构、索引、视图、存储过程等进行相应的调整,确保它们在新数据库中能...
**OA网络自动化办公系统**是基于SSH(Struts、Spring、Hibernate)三层架构设计的,它结合了SQL Server 2005数据库以及jQuery和Ajax技术,旨在提供高效、便捷的办公自动化解决方案。 **SSH框架详解:** 1. **Struts...
Java连接SQL Server主要依赖于JDBC驱动,如Microsoft JDBC Driver for SQL Server。连接过程包括加载驱动、设置数据库URL、用户名和密码,然后建立连接。 5. **MongoDB数据库连接**:MongoDB是非关系型数据库,适用...
5. **SQL Server**:SQL Server是微软公司开发的一款商业数据库系统,提供强大的企业级功能,包括高可用性、安全性以及数据仓库解决方案,适用于大型企业。 文件名中包含"mvc_sql",这可能意味着教程会涉及SQL查询...
9. **高可用性与灾难恢复**:讨论SQL Server的高可用性解决方案,如镜像、复制、Always On Availability Groups等,以及如何设计灾难恢复计划。 10. **最佳实践**:总结在SQL Server管理和开发中的常见最佳实践,...
5. **文档编写**:包括课程设计报告,详述系统的设计思路、实现方法以及遇到的问题和解决方案。 通过这个项目,学生可以全面了解Web应用的开发流程,提升Java编程、数据库设计及管理的能力,并实践软件工程中的各种...
Struts2负责控制流程,Spring处理依赖注入和事务管理,Hibernate则作为数据持久层的解决方案,而sqljdbc4.jar则是连接这些组件与SQL Server数据库的桥梁。 在实际项目中,这四个组件的整合使用可以帮助开发者快速...
五、远程服务器的挑战与解决方案: 在远程服务器上进行数据库操作,网络延迟会成为性能瓶颈。为优化性能,可以采取以下策略: 1. 数据库复制:设置数据库镜像或读写分离,将读操作分散到多个副本服务器上。 2. 异步...
标题中的“基于JAVA和SQL SERVER数据库实现的医院病房信息管理系统”揭示了这是一个使用...这个医院病房信息管理系统结合了Java的开发能力和SQL Server的数据管理优势,为医院提供了一套高效、可靠的信息化解决方案。
本资源包含了一系列针对不同数据库的架包和连接数据库的代码,适用于多种环境,包括SQLServer2000、SQLServer2005、MySQL、Oracle以及DWR和Hibernate。下面将详细介绍这些知识点。 1. **SQLServer**:微软公司开发...
例如,URL应改为`jdbc:jtds:sqlserver://servername:port/databasename`格式。 4. **测试连接**:完成上述步骤后,进行测试以确保新的驱动能够成功连接并执行SQL查询。 "jtds-1.2.5-dist"压缩包很可能包含了jtds...