本文整理汇总了Java中javax.sql.rowset.Joinable类的典型用法代码示例。如果您正苦于以下问题:Java Joinable类的具体用法?Java Joinable怎么用?Java Joinable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Joinable类属于javax.sql.rowset包,在下文中一共展示了Joinable类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRowSet
import javax.sql.rowset.Joinable; //导入依赖的package包/类
@Override
public void addRowSet(Joinable rowset) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
示例2: addRowSet
import javax.sql.rowset.Joinable; //导入依赖的package包/类
public void addRowSet(Joinable rowset) throws SQLException {
if (rowset == null || !(rowset instanceof RowSet)) {
// rowset.33=Not a rowset
throw new SQLException(Messages.getString("rowset.33")); //$NON-NLS-1$
}
RowSet currentRs = (RowSet) rowset;
if (currentRs.getMetaData() == null) {
// rowset.32=The given rowset is empty
throw new SQLException(Messages.getString("rowset.32")); //$NON-NLS-1$
}
int matchCol = -1;
try {
if (rowset.getMatchColumnIndexes() != null
&& rowset.getMatchColumnIndexes().length > 0) {
matchCol = rowset.getMatchColumnIndexes()[0];
if (matchCol <= 0
|| matchCol > currentRs.getMetaData().getColumnCount()) {
matchCol = -2;
}
}
} catch (SQLException e) {
try {
if (rowset.getMatchColumnNames() != null
&& rowset.getMatchColumnNames().length > 0) {
try {
matchCol = currentRs.findColumn(rowset
.getMatchColumnNames()[0]);
} catch (SQLException e1) {
matchCol = -3;
}
}
} catch (SQLException e2) {
// ignore
}
} finally {
if (matchCol == -1) {
// rowset.34=Not set a match column
throw new SQLException(Messages.getString("rowset.34")); //$NON-NLS-1$
} else if (matchCol == -2) {
// rowset.35=Not a valid match olumn index
throw new SQLException(Messages.getString("rowset.35")); //$NON-NLS-1$
} else if (matchCol == -3) {
// rowset.1=Not a valid column name
throw new SQLException(Messages.getString("rowset.1")); //$NON-NLS-1$
}
}
addRowSet(currentRs, matchCol);
}