日期:2014-05-17  浏览次数:21353 次

TDS 协议流无效,请教解决方法
严重: TDSReader@6f0f (ConnectionID:28) got unexpected value in TDS response at offset:7992
[2013-12-28 16:31:00,078]-ERROR (JDBCExceptionReporter.java:101)|TDS 协议流无效。
[2013-12-28 16:31:00,421]-ERROR (CommonsLogger.java:27)|Hibernate operation: could not load an entity: [com.ahqx.zhgl.common.db.genmodel.LineInfoPO#68]; uncategorized SQLException for SQL [select lineinfopo0_.ID as ID15_0_, lineinfopo0_.CarID as CarID15_0_, lineinfopo0_.distance as distance15_0_, lineinfopo0_.stime as stime15_0_, lineinfopo0_.etime as etime15_0_, lineinfopo0_.geo as geo15_0_ from dbo.lineinfo lineinfopo0_ where lineinfopo0_.ID=?]; SQL state [null]; error code [0]; TDS 协议流无效。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: TDS 协议流无效。
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not load an entity: [com.ahqx.zhgl.common.db.genmodel.LineInfoPO#68]; uncategorized SQLException for SQL [select lineinfopo0_.ID as ID15_0_, lineinfopo0_.CarID as CarID15_0_, lineinfopo0_.distance as distance15_0_, lineinfopo0_.stime as stime15_0_, lineinfopo0_.etime as etime15_0_, lineinfopo0_.geo as geo15_0_ from dbo.lineinfo lineinfopo0_ where lineinfopo0_.ID=?]; SQL state [null]; error code [0]; TDS 协议流无效。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: TDS 协议流无效。




调用的java内部方法是
/**
 * 转换点
 * @param x gps真实点x
 * @param y gps真实点y
 * @return 点对象
 */
public static Point getXY(String x,String y){
String lng = x.substring(0, x.indexOf(".")+3);
String lat = y.substring(0, y.indexOf(".")+3);
List listLNGLAT = map.get(lng+","+lat);
if(listLNGLAT==null){
String formatLNGLAT = "select offsetlng,offsetlat from offset_bd where lng like '"+lng+"%' and lat like '"+lat+"%'";
listLNGLAT = AppImpl.getMe().getAllServicesCommon().getCommonOrgServiceIntf().getAllDaos().getCarPointDao().findListBySql(formatLNGLAT, null);
map.put(lng+","+lat, listLNGLAT);
}
if(listLNGLAT.size()>0){
Object [] obj = (Object[])listLNGLAT.get(0);
try {
Double lngt = Double.parseDouble(x)+Double.parseDouble(obj[0].toString());
Double latt = Double.parseDouble(y)+Double.parseDouble(obj[1].toString());
return new Point(lngt.toString(), latt.toString());
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
return null;
}


数据库是sql server2000,表中有字段是text类型,数据量很大。