本文整理了Java中com.healthmarketscience.jackcess.Table.getColumns()
方法的一些代码示例,展示了Table.getColumns()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getColumns()
方法的具体详情如下:
包路径:com.healthmarketscience.jackcess.Table
类名称:Table
方法名:getColumns
暂无
代码示例来源:origin: pentaho/pentaho-kettle
public static final RowMetaInterface getLayout( Table table ) throws SQLException, KettleStepException {
RowMetaInterface row = new RowMeta();
List<Column> columns = table.getColumns();
for ( int i = 0; i < columns.size(); i++ ) {
Column column = columns.get( i );
代码示例来源:origin: pentaho/pentaho-kettle
List<Column> col = t.getColumns();
int nr = col.size();
for ( int i = 0; i < nr; i++ ) {
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
@Override
public List<? extends Column> getColumns() {
return wrapped.getColumns();
}
代码示例来源:origin: com.healthmarketscience.jackcess/jackcess
public static boolean isMultiValueColumn(Table typeObjTable) {
// if we found a single value of a "simple" type, then we are dealing with
// a multi-value column
List<? extends Column> typeCols = typeObjTable.getColumns();
return ((typeCols.size() == 1) &&
MULTI_VALUE_TYPES.contains(typeCols.get(0).getType()));
}
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
private boolean hasAppendOnly(Table t) {
for (Column c : t.getColumns()) {
if (c.isAppendOnly()) {
return true;
}
}
return false;
}
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
private void saveColumnsDefaults(String[] defaults, Boolean[] required, Table table) throws IOException {
List<? extends Column> cols = table.getColumns();
int j = 0;
if (defaults != null || required != null) {
for (Column cl : cols) {
saveColumnsDefaults(defaults, required, cl, j);
j++;
}
}
}
代码示例来源:origin: io.github.codemumbler/mdb-oracle-converter
@SuppressWarnings("unchecked")
private List<com.healthmarketscience.jackcess.Column> getColumns(String tableName) throws IOException {
return (List<com.healthmarketscience.jackcess.Column>) jackcessDatabase.getTable(tableName).getColumns();
}
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
private Map<String, Object> escapeIdentifiers(Map<String, Object> map, Table t) {
List<? extends Column> colums = t.getColumns();
Map<String, Object> vl = new LinkedHashMap<String, Object>();
for (Column cl : colums) {
String key = cl.getName();
String keyu = key.toUpperCase();
String ekey = map.containsKey(keyu) ? keyu : SQLConverter.escapeIdentifier(key).toUpperCase();
if (!map.containsKey(ekey) && map.containsKey(ekey.substring(1, ekey.length() - 1))) {
ekey = ekey.substring(1, ekey.length() - 1);
}
vl.put(key, map.get(ekey));
}
return vl;
}
代码示例来源:origin: com.healthmarketscience.jackcess/jackcess
public static boolean isVersionHistoryColumn(Table typeObjTable) {
// version history data has these columns <value>(MEMO),
// <modified>(SHORT_DATE_TIME)
List<? extends Column> typeCols = typeObjTable.getColumns();
if(typeCols.size() < 2) {
return false;
}
int numMemo = 0;
int numDate = 0;
for(Column col : typeCols) {
switch(col.getType()) {
case SHORT_DATE_TIME:
++numDate;
break;
case MEMO:
++numMemo;
break;
default:
// ignore
}
}
// be flexible, allow for extra columns...
return((numMemo >= 1) && (numDate >= 1));
}
}
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
private void setDefaultValues(Table t) throws SQLException, IOException {
String tn = t.getName();
String ntn = escapeIdentifier(tn);
List<? extends Column> lc = t.getColumns();
List<String> arTrigger = new ArrayList<String>();
for (Column cl : lc) {
setDefaultValue(cl, ntn, arTrigger);
}
for (String trigger : arTrigger) {
exec(trigger, true);
}
}
代码示例来源:origin: apache/tika
Table table = it.next();
String tableName = table.getName();
List<? extends Column> columns = table.getColumns();
xhtml.startElement("table", "name", tableName);
addHeaders(columns, xhtml);
代码示例来源:origin: com.healthmarketscience.jackcess/jackcess
protected static void diffFlatColumns(Table typeObjTable,
Table flatTable,
List<Column> typeCols,
List<Column> otherCols)
{
// each "flat"" table has the columns from the "type" table, plus some
// others. separate the "flat" columns into these 2 buckets
for(Column col : flatTable.getColumns()) {
if(((TableImpl)typeObjTable).hasColumn(col.getName())) {
typeCols.add(col);
} else {
otherCols.add(col);
}
}
}
代码示例来源:origin: org.integratedmodelling/klab-common
@Override
public Collection<IColumn> getColumns() {
ArrayList<IColumn> ret = new ArrayList<IColumn>();
try {
for (com.healthmarketscience.jackcess.Column cc : getTable().getColumns()) {
ret.add(new Column(cc.getName()));
}
} catch (KlabIOException e) {
ret.clear();
}
return ret;
}
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
public UpdateCommand(Table _table, Map<String, Object> _map, Object[] _modifiedRow, String _execId) {
this.tableColumns = _table.getColumns();
this.indexSelector = new IndexSelector(_table);
this.rowPattern = _map;
this.modifiedRow = _modifiedRow;
this.execId = _execId;
checkBlob(_modifiedRow);
this.table = _table;
}
代码示例来源:origin: AccelerationNet/access2csv
static void schema(File inputFile) throws IOException{
Database db = DatabaseBuilder.open(inputFile);
try{
for(String tableName : db.getTableNames()){
Table table = db.getTable(tableName);
System.out.println(String.format("CREATE TABLE %s (", tableName));
for(Column col : table.getColumns()){
System.out.println(String.format(" %s %s,",
col.getName(), col.getType()));
}
System.out.println(")");
}
}finally{
db.close();
}
}
代码示例来源:origin: org.integratedmodelling/klab-common
@Override
public IColumn getColumn(String columnName) {
boolean ok = false;
try {
for (com.healthmarketscience.jackcess.Column cc : getTable().getColumns()) {
if (cc.getName().equals(columnName)) {
ok = true;
break;
}
}
} catch (KlabIOException e) {
}
return ok ? new Column(columnName) : null;
}
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
private static boolean hasAutoNumberColumn(Table t) {
List<? extends Column> lc = t.getColumns();
for (Column cl : lc) {
if (cl.isAutoNumber() || DataType.BOOLEAN.equals(cl.getType())) {
return true;
}
}
return false;
}
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
private String getExpression(Column cl) throws IOException {
PropertyMap map = cl.getProperties();
Property exprp = map.get(PropertyMap.EXPRESSION_PROP);
if (exprp != null) {
Table tl = cl.getTable();
String expr = SQLConverter.convertPowOperator((String) exprp.getValue());
for (Column cl1 : tl.getColumns()) {
expr = expr.replaceAll("\\[(?i)(" + Pattern.quote(cl1.getName()) + ")\\]", "newrow.$0");
}
return expr;
}
return null;
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public JackcessDenseObjectMatrix2D(File file, String tablename) throws IOException {
super(0, 0);
database = DatabaseBuilder.open(file);
VerifyUtil.verifyNotNull(database, "database could not be opened");
table = database.getTable(tablename);
VerifyUtil.verifyNotNull(table, "table not found in database");
columns = table.getColumns();
cursor = CursorBuilder.createCursor(table);
for (int i = 0; i < columns.size(); i++) {
setColumnLabel(i, columns.get(i).getName());
}
setLabel(tablename);
}
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
private void persist(Cursor cur) throws IOException, SQLException {
Object[] mr = this.modifiedRow;
if (table.getDatabase().getColumnOrder().equals(ColumnOrder.DISPLAY)) {
Object[] newRowReorded = new Object[this.modifiedRow.length];
int j = 0;
for (Column cli : table.getColumns()) {
newRowReorded[cli.getColumnIndex()] = this.modifiedRow[j];
j++;
}
mr = newRowReorded;
}
cur.updateCurrentRow(mr);
}
内容来源于网络,如有侵权,请联系作者删除!