当前位置: 技术问答>java相关
是因为中文字段的问题吗?
来源: 互联网 发布时间:2015-09-08
本文导语: 在调用下面的class的GetItemBytes(int aColID)时出错,调用语句为: sTHDR = new String(theDataModel.GetItemBytes(2),"GBK"); 错误信息为: java.sql.SQLException: JZ0TE: 试图在非法的类型对之间进行 转换。有效的数据库数据类型为:'varbinay...
在调用下面的class的GetItemBytes(int aColID)时出错,调用语句为:
sTHDR = new String(theDataModel.GetItemBytes(2),"GBK");
错误信息为:
java.sql.SQLException: JZ0TE: 试图在非法的类型对之间进行 转换。有效的数据库数据类型为:'varbinay, long binary, binary, image'
package Legend.water;
import java.sql.SQLException;
import java.util.Date;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.lang.Byte;
import java.sql.Types;
public class DataModel implements PrintHttp {
private String SQLSelect;
private long RowCount;
private long ColCount;
public DbConnect theDbConnect;
public ResultSet myResultSet;
public ResultSetMetaData myResultSetMetaData;
public Statement myStatement;
public HttpTable theHttpTable;
/**
@roseuid 392C76410066
*/
public int GetColCount() throws SQLException {
return myResultSetMetaData.getColumnCount();
}
/**
@roseuid 392DBA8C0011
*/
public DataModel() {
}
/**
@roseuid 392C78FB001A
*/
public void GetTableColumn(TableColumn theTableColumn[]) throws SQLException {
String sColName=null;
String sTmpSql,sTmp;
ColCount = GetColCount();
try{
for (int i= 0; i
sTHDR = new String(theDataModel.GetItemBytes(2),"GBK");
错误信息为:
java.sql.SQLException: JZ0TE: 试图在非法的类型对之间进行 转换。有效的数据库数据类型为:'varbinay, long binary, binary, image'
package Legend.water;
import java.sql.SQLException;
import java.util.Date;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.lang.Byte;
import java.sql.Types;
public class DataModel implements PrintHttp {
private String SQLSelect;
private long RowCount;
private long ColCount;
public DbConnect theDbConnect;
public ResultSet myResultSet;
public ResultSetMetaData myResultSetMetaData;
public Statement myStatement;
public HttpTable theHttpTable;
/**
@roseuid 392C76410066
*/
public int GetColCount() throws SQLException {
return myResultSetMetaData.getColumnCount();
}
/**
@roseuid 392DBA8C0011
*/
public DataModel() {
}
/**
@roseuid 392C78FB001A
*/
public void GetTableColumn(TableColumn theTableColumn[]) throws SQLException {
String sColName=null;
String sTmpSql,sTmp;
ColCount = GetColCount();
try{
for (int i= 0; i