急问~~~,求支持记录自由移动的 for mysql的jdbc驱动!!
我看了org.gjt.mm.mysql的class说明了
没有ResultSet.first()这个方法!!
http://www.csuchico.edu/computing/JAVAINFO/MM.MSQL.JDBC/apidoc/org/gjt/mm/mysql/ResultSet.html
com.caucho.jdbc.mysql的又封装的厉害 看不到java文件 也没文档说明
但是用了没效果!!
try {
ResultSet rs=q.executeQuery("select name from a");
while(rs.next())
{
out.println(rs.getString(1));
}
//rs.beforeFirst();
// rs.first();
rs.last();
int i=rs.getRow();
out.print(i);
}
catch (SQLException e)
{
out.println("错误");
out.print(e);
}
错误为:
asdas asdassd asd 错误 java.sql.SQLException: can't call getRow() after close()
(错误两字前是记录--正常,但是用rs.last()就出错,如果没有rs.last()也出错。
用rs.first()没效果
请问还有哪个FOR MYSQL的JDBC驱动支持自由移动啊????
我已经这样声明statement了
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
问题点数:0、回复次数:3Top
1 楼MeE(巴顿)回复于 2003-02-02 09:44:10 得分 0
faint!mm.mysql 3.1版出来了
我以为问题就解决了,
解开源代码一看,起初还挺高兴的 因为终于发现first(),last()函数的踪影了
看看:)
ResultSet.last();
public boolean last() throws SQLException {
if (Driver.TRACE) {
Object[] args = { };
Debug.methodCall(this, "last", args);
}
if (rowData.size() == 0) {
return false;
} else {
if (onInsertRow) {
onInsertRow = false;
}
if (doingUpdates) {
doingUpdates = false;
}
rowData.beforeLast();
thisRow = rowData.next();
return true;
}
}
ResultSet.first();
public boolean first() throws SQLException {
if (Driver.TRACE) {
Object[] args = { };
Debug.methodCall(this, "first", args);
}
if (onInsertRow) {
onInsertRow = false;
}
if (rowData.isEmpty()) {
return false;
} else {
if (doingUpdates) {
doingUpdates = false;
}
rowData.beforeFirst();
thisRow = rowData.next();
return true;
}
}
在看看这两个函数有什么相同和不同?
相同的地方就是thisRow = rowData.next();
我找了RowData.java看了看 结果发现 这个是空的文件!!!!
只有
/**
* Returns the next row.
*
* @return the next row value
* @throws SQLException if a database error occurs
*/
byte[][] next() throws SQLException;
555555555555555555555
问题什么也没解决!!
java.lang.AbstractMethodError: org.gjt.mm.mysql.ResultSet.last()Z
函数还是没用
我狂ft!
(不过想不到这个JDBC驱动居然是全球的CVS做的,不知道有没有我们中国人的份哦~~)
哎。。。。
我在热切盼望能自由移动的MYSQL-JDBC驱动Top
2 楼MeE(巴顿)回复于 2003-02-02 09:44:55 得分 0
BTW:连getRow()也是这样的。Top
3 楼MeE(巴顿)回复于 2003-02-02 09:48:31 得分 0
可能他们写的函数错了。。。Top




