传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。参数 1 (""): 数据类型 0x38 未知

因公司升级数据库从sqlserver2000到sqlserver2008,数据源的配置还是使用sqlserver2000配置所以造成一下问题:

传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。参数 1 (""): 数据类型 0x38 未知


sqlserver2000数据源配置:

<Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=sample"
username="sa" password="1234" maxActive="5" maxIdle="2" maxWait="5000" />

sqlserver2008数据源配置

<Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://lcoalhost:1433;DatabaseName=test"
username="sa" password="1234" maxActive="5" maxIdle="2" maxWait="5000" />

两者class和url是不一样的。

升级后使用sqlserver2008数据源配置并升级jar包即可

关于jar包说明:

压缩包中sqljdbc.jar 支持jdk1.5

sqljdbc4.jar支持jdk1.6及以上

jar包下载地址:https://www.microsoft.com/zh-cn/download/details.aspx?id=21599

展开阅读全文

[SQLServer 2000 Driver for JDBC][SQLServer]传入表格格式数据流(TDS)远程过程调用(RPC)协议不正确

09-26

AppProperties app = AppProperties.getInstance();rn String url = app.getPropertyValue("docExchange.qianzhiji.db.url");rn String userName = app.getPropertyValue("docExchange.qianzhiji.db.userName");rn String password = app.getPropertyValue("docExchange.qianzhiji.db.password");rn Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver")rn .newInstance(); rn conn = DriverManager.getConnection(url, userName, password);rnSQL的链接是这么写的,程序运行conn是有值的链接正常 当是执行rnPreparedStatement prestat = conn.prepareStatement("select * from t_ShouLi s where s.slsj >'" + oldTime.getOldTime() + "' and s.slsj<='" + nowTime + "'");rn报错,信息如下:rn9-26 16:39:18 错误 [con.err] java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。参数 1 (""): 数据类型 0x38 未知。rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.toone.egov.dataExchange.dao.imp.DataExchangeDAOImpl.getShouliList(DataExchangeDAOImpl.java:57)rn2010-09-26 16:39:18 错误 [con.err] at com.toone.egov.dataExchange.manager.DataExchangeManager.getShouliList(DataExchangeManager.java:20)rn2010-09-26 16:39:18 错误 [con.err] at com.toone.egov.dataExchange.service.imp.DataExchangeServiceImpl.startRecDataTimer(DataExchangeServiceImpl.java:58)rn2010-09-26 16:39:18 错误 [con.err] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn2010-09-26 16:39:18 错误 [con.err] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn2010-09-26 16:39:18 错误 [con.err] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn2010-09-26 16:39:18 错误 [con.err] at java.lang.reflect.Method.invoke(Method.java:597)rn2010-09-26 16:39:18 错误 [con.err] at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61)rn2010-09-26 16:39:18 错误 [con.err] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:142)rn2010-09-26 16:39:18 错误 [con.err] at $Proxy0.startRecDataTimer(Unknown Source)rn2010-09-26 16:39:18 错误 [con.err] at com.toone.egov.task.AutoRecProjectAccept.run(AutoRecProjectAccept.java:14)rn2010-09-26 16:39:18 错误 [con.err] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)rn2010-09-26 16:39:18 错误 [con.err] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)rn2010-09-26 16:39:18 错误 [con.err] at java.util.concurrent.FutureTask.run(FutureTask.java:138)rn2010-09-26 16:39:18 错误 [con.err] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)rn2010-09-26 16:39:18 错误 [con.err] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)rn2010-09-26 16:39:18 错误 [con.err] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)rn2010-09-26 16:39:18 错误 [con.err] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)rn2010-09-26 16:39:18 错误 [con.err] at java.lang.Thread.run(Thread.java:619)rnrn网上查了说是我的SQL驱动不对 换成2005的 但是也是不行。各为帮帮忙 论坛

|zyicis| 传入表格格式数据流(TDS)远程过程调用(RPC)协议不正确RPC 名无效。第二次执行时出错提示

01-04

System.Web.Services.Protocols.SoapException: 服务器无法处理请求。 ---> System.Exception: 传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。RPC 名无效。Trace info:INSERT INTO [Pos_SaleDetail]rn我的代码环境是这样的rn执入商品明细成功的时候就执行一个扣减库存的存储过程SPSalernrn代码如下C#rnrn开启事务rntryrnrn DataTable dt = GetMyDate("001")这里得到我001订单的订单明细到dt中rn for(int i=0;iM=dt.rows.count -1;i++)rn rn String sql="Insert into ...." //这里是根据当前的dt中的row[i]生成的SQL语句rn if(oo.ExecNonQuery(sql)>0)rn rn oo.IsStoredProcedure=true;//这里为执行存储过程rn oo.ExecNonQuery("SPSale");//执行库存扣减 rn rn elsern rn Throw new Exception("插入出错");//如果没有插入记录,报错rn rn rn 提交事务rnrncatchrnrn 回滚事务rnrnfinallyrnrn 结束事务rn 清空资源rnrnrn--------------------------------------rn以下是存储过程rnSPSalern事务开启rn 扣减提交进来的货品的库存数量rn事务提交rn-----------------------------------------------rn在这我里的代码,在dt中第一行执行是成功的,但第二行if(oo.ExecNonQuery(sql)>0)执行时就报:rnSystem.Web.Services.Protocols.SoapException: 服务器无法处理请求。 ---> System.Exception: 传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。RPC 名无效。Trace info:INSERT INTO [SaleDetail] ... ....rn但我把代码考出来一句一句执行又没有错rnrn谢谢rn 论坛

没有更多推荐了,返回首页