D
dingyuan
Unregistered / Unconfirmed
GUEST, unregistred user!
我不知道大家是否也会经常遇上这样的问题,我经常会发生:
首先定义一下
<%
Driver DriverRecordset1 = (Driver)Class.forName(MM_test_DRIVER).newInstance();
Connection ConnRecordset1 = DriverManager.getConnection(MM_test_STRING,MM_test_USERNAME,MM_test_PASSWORD);
PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("{call dbo.getexam}@sort='a'");
ResultSet Recordset1 = StatementRecordset1.executeQuery();
boolean Recordset1_isEmpty = !Recordset1.next();
boolean Recordset1_hasData = !Recordset1_isEmpty;
Object Recordset1_data;
int Recordset1_numRows = 0;
%>
中间会有一段别的程序,如HTML语句。当引用上面的Recordset时有时候就会错,
<td><%=(((Recordset1_data = Recordset1.getObject("no"))==null || Recordset1.wasNull())?"":Recordset1_data)%></td>
<td><%=(((Recordset1_data = Recordset1.getObject("exam"))==null || Recordset1.wasNull())?"":Recordset1_data)%></td>
注意我说的是有时候,并不总是这样.错误提示如下:
java.sql.SQLEXception:[Microsoft][ODBS SQL Sever Driver]无效的描述符索引
如果编译能通过,就没有问题了,但如果通不过就总也通不过,好象与先后顺序有关,谁
来助我。
首先定义一下
<%
Driver DriverRecordset1 = (Driver)Class.forName(MM_test_DRIVER).newInstance();
Connection ConnRecordset1 = DriverManager.getConnection(MM_test_STRING,MM_test_USERNAME,MM_test_PASSWORD);
PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("{call dbo.getexam}@sort='a'");
ResultSet Recordset1 = StatementRecordset1.executeQuery();
boolean Recordset1_isEmpty = !Recordset1.next();
boolean Recordset1_hasData = !Recordset1_isEmpty;
Object Recordset1_data;
int Recordset1_numRows = 0;
%>
中间会有一段别的程序,如HTML语句。当引用上面的Recordset时有时候就会错,
<td><%=(((Recordset1_data = Recordset1.getObject("no"))==null || Recordset1.wasNull())?"":Recordset1_data)%></td>
<td><%=(((Recordset1_data = Recordset1.getObject("exam"))==null || Recordset1.wasNull())?"":Recordset1_data)%></td>
注意我说的是有时候,并不总是这样.错误提示如下:
java.sql.SQLEXception:[Microsoft][ODBS SQL Sever Driver]无效的描述符索引
如果编译能通过,就没有问题了,但如果通不过就总也通不过,好象与先后顺序有关,谁
来助我。