- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何在 CsvJdbc 中启用 ResultSet.getRow()?
(这是一个应该返回当前行号的函数)
它似乎依赖于 isScrollable
成员。如果有人以前遇到过这个问题,您如何解决它?
Properties
对象中设置的属性吗?谢谢!
<小时/>更多信息
我使用的应用程序能够从任何 JDBC 源导入数据。我需要从 CSV 文件中获取一些数据,因此我使用 CsvJdbc。此应用程序需要访问其导入的每行数据的行号,不幸的是 CsvResultSet#getRow() 抛出异常,提示“Csv Jdbc : ResultSet.getRow() 不受支持”。
以下是实现。 CsvJdbc 中的 getRow()
方法 (1.0.5)
/**
* Retrieves the current row number. The first row is number 1, the
* second number 2, and so on.
*
* @return the current row number; <code>0</code> if there is no current row
* @exception SQLException if a database access error occurs
*/
public int getRow() throws SQLException {
if (this.isScrollable == ResultSet.TYPE_SCROLL_SENSITIVE) {
return currentRow;
} else {
throw new UnsupportedOperationException(
"ResultSet.getRow() unsupported");
}
}
查看源代码的其余部分,似乎唯一设置 isScrollable
成员属性的位置是在构造函数中并作为默认值。
最佳答案
您是否尝试过创建可滚动的语句...
语句 stmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
关于java - Csv Jdbc : ResultSet. getRow() 不受支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5137997/
Java文档 int getRow() throws SQLException Retrieves the current row number. The first row is number 1,
现有10W条数据,Access数据库保存 通过正常提取: 复制代码代码如下: <% Set conn= Server
我正在使用 Adodb 连接并读取查询结果放入一个数组中 array = recordSet.GetRows() 这导致一个转置的维度数组 (row,col) (0, 0) (0, 1) (0, 2)
下面的 VBA 代码完成了这项工作,但我在转置部分损失了大约 3 秒。 有没有一种方法可以在不损失 3 秒的情况下在 SQL 查询或 getrows 过程中获得相同的结果? Sub LoadData(
void gridControl1_DoubleClick(object sender, EventArgs e) { GridControl grid = sender as GridCon
阅读以下代码: public class selectTable { public static ResultSet rSet; public static int total=0; public s
本文整理了Java中jxl.write.WritableCell.getRow()方法的一些代码示例,展示了WritableCell.getRow()的具体用法。这些代码示例主要来源于Github/S
为了提高性能和资源,我刚刚开始在我的一些脚本中使用 getRows()。我刚遇到一个问题,想请教一下。 我这样做是为了获取记录集并获取计数: If NOT rs.EOF Then arrRes
我正在使用此方法从数据库中获取行并显示在前端上,但是当它执行时,会出现 fatal error Fatal error: Call to a member function getRow() on a
我正在处理大型稀疏二进制矩阵。我使用 Scipy 稀疏矩阵实现对它们进行了压缩。 scipy.spatial.distance 的Jaccard 距离 的计算不支持对稀疏矩阵的直接操作,因此: 将整个
我试图使用 getRow() 方法(描述 here ) 但是当运行我的网页时,我得到 "Uncaught TypeError: Object # has no method 'getRow' " .
我有一个 JTextArea 我想根据列数和行数显示特定的文本行数组;但是 getColumns 和 getRows 返回零。以下内容应该让我了解我要完成的工作: public class Frame
我正在尝试从我在 Netbeans 中设置的嵌入式数据库填充我的 JTable。 我的数据库包含 3 行和 3 列,我想将其插入到 JTable 中,并使该表在我的 GUI 应用程序中可见。 但是,如
如何在 CsvJdbc 中启用 ResultSet.getRow()? (这是一个应该返回当前行号的函数) 它似乎依赖于 isScrollable 成员。如果有人以前遇到过这个问题,您如何解决它? 这
我已经在我的服务器上上传了 Fiverr 脚本并在那里上传了数据库,安装后该网站运行良好。在我向其上传项目后,我在索引页面上不断收到此错误。 这是网址:http://jobbyu.com/ 这是我收到
假设我有大量线程使用 Java.sql 插入到 mysql 数据库中。在我执行插入后,我想知道我刚刚插入的记录的主键。我可以使用 getRow()在插入查询返回的 ResultSet 上。但是,这个线
本文整理了Java中com.ctc.wstx.sw.XmlWriter.getRow()方法的一些代码示例,展示了XmlWriter.getRow()的具体用法。这些代码示例主要来源于Github/S
我正在 Java 中使用 Excel (xlsx)。我一直不明白返回值类型来自getRow(int RowNum)。 “它返回逻辑行(从 0 开始)”是什么意思?请参阅下面的代码。 row=sheet
在我的 Excel 选项卡 Pane 插件中,我想仅根据事件选定行从范围中获取一些行。 最初我的数据位于“Sheet1!H5:I16”中,我在工作表中仅选择没有表的行。 “表1!8:10” 为了检测选
我想使用索引获取表中行的行组成部分,如下所示: row_1 = table.getRow(1); console.log(row_1); 但它会产生警告:“查找错误 - 未找到匹配行:
我是一名优秀的程序员,十分优秀!