private static TableColumnInfo[] getData(ISQLConnection conn, ITableInfo ti) throws SQLException { if (conn == null) { throw new IllegalArgumentException("SQLConnection == null"); } if (ti == null) { throw new IllegalArgumentException("ITableInfo == null"); } return conn.getSQLMetaData().getColumnInfo(ti); }
/** * * @param sourceConn * @param ti * @return * @throws SQLException */ public static int getColumnCount(ISQLConnection sourceConn, ITableInfo ti) throws SQLException { return sourceConn.getSQLMetaData().getColumnInfo(ti).length; }
private static TableColumnInfo[] getData(ISQLConnection conn, ITableInfo ti) throws SQLException { if (conn == null) { throw new IllegalArgumentException("SQLConnection == null"); } if (ti == null) { throw new IllegalArgumentException("ITableInfo == null"); } return conn.getSQLMetaData().getColumnInfo(ti); }
protected void loadColumns() { try { List<String> cols = new ArrayList<String>(); TableColumnInfo[] infos = dmd.getColumnInfo(catalog, schema, name); for (int i = 0; i < infos.length; i++) { cols.add(infos[i].getColumnName()); } setColumns(cols); } catch (SQLException e) { throw new RuntimeException(e.getMessage()); } } }
protected void loadColumns() { try { List<String> cols = new ArrayList<String>(); TableColumnInfo[] infos = dmd.getColumnInfo(catalog, schema, name); for (int i = 0; i < infos.length; i++) { cols.add(infos[i].getColumnName()); } setColumns(cols); } catch (SQLException e) { throw new RuntimeException(e.getMessage()); } } }
public static int[] getColumnTypes(ISQLConnection con, ITableInfo ti) throws SQLException { TableColumnInfo[] infoArr = con.getSQLMetaData().getColumnInfo(ti); int[] result = new int[infoArr.length]; for (int i = 0; i < result.length; i++) { TableColumnInfo colInfo = infoArr[i]; result[i] = colInfo.getDataType(); } return result; }
/** * * @param con * @param ti * @param column * @return * @throws SQLException */ public static int getColumnType(ISQLConnection con, ITableInfo ti, int column) throws SQLException { TableColumnInfo[] infoArr = con.getSQLMetaData().getColumnInfo(ti); TableColumnInfo colInfo = infoArr[column]; return colInfo.getDataType(); }
/** * * @param sourceConn * @param ti * @param column * @return * @throws SQLException */ public static String getColumnName(ISQLConnection sourceConn, ITableInfo ti, int column) throws SQLException { TableColumnInfo[] infoArr = sourceConn.getSQLMetaData().getColumnInfo(ti); TableColumnInfo colInfo = infoArr[column]; return colInfo.getColumnName(); }
/** * * @param sourceConn * @param ti * @return * @throws SQLException */ public static String[] getColumnNames(ISQLConnection sourceConn, ITableInfo ti) throws SQLException { TableColumnInfo[] infoArr = sourceConn.getSQLMetaData().getColumnInfo(ti); String[] result = new String[infoArr.length]; for (int i = 0; i < result.length; i++) { TableColumnInfo colInfo = infoArr[i]; result[i] = colInfo.getColumnName(); } return result; }
protected int getFirstColumnType(ITableInfo ti) throws SQLException { TableColumnInfo[] infos = _session.getSQLConnection().getSQLMetaData().getColumnInfo(ti); return infos[0].getDataType(); }
protected String getFirstColumnName(ITableInfo ti) throws SQLException { TableColumnInfo[] infos = _session.getSQLConnection().getSQLMetaData().getColumnInfo(ti); return infos[0].getColumnName(); }
public static int[] getColumnTypes(ISQLConnection con, ITableInfo ti, String[] colNames) throws SQLException { TableColumnInfo[] tciArr = con.getSQLMetaData().getColumnInfo(ti); int[] result = new int[tciArr.length]; for (int i = 0; i < tciArr.length; i++) { boolean found = false; for (int j = 0; j < colNames.length && !found; j++) { String columnName = colNames[j]; if (tciArr[i].getColumnName().equalsIgnoreCase(columnName)) { result[i] = tciArr[i].getDataType(); found = true; } } } return result; }
/** * * @param con * @param synonym * @param columnName * @return * @throws SQLException */ public static int getColumnType(ISQLConnection con, ITableInfo ti, String columnName) throws SQLException { int result = -1; if (ti != null) { TableColumnInfo[] tciArr = con.getSQLMetaData().getColumnInfo(ti); for (int i = 0; i < tciArr.length; i++) { if (tciArr[i].getColumnName().equalsIgnoreCase(columnName)) { result = tciArr[i].getDataType(); break; } } } return result; }
TableColumnInfo[] infos = conn.getSQLMetaData().getColumnInfo(ti); for (int i = 0; i < infos.length; i++)
/** * @see net.sourceforge.squirrel_sql.plugins.refactoring.commands.AbstractRefactoringCommand#onExecute() */ @Override protected void onExecute() throws SQLException { if (!(_info[0] instanceof ITableInfo)) { s_log.error("onExecute: _info[0] isn't an instance of ITableInfo: class=" + _info[0].getClass().getName()); return; } ITableInfo ti = (ITableInfo) _info[0]; TableColumnInfo[] columns = _session.getSQLConnection().getSQLMetaData().getColumnInfo(ti); if (columns.length < 2) { // If the table has only one column, it cannot be dropped _session.showErrorMessage(i18n.SINGLE_COLUMN_MESSAGE); } else { showCustomDialog(); } }
TableColumnInfo[] infos = md.getColumnInfo(catalog, schema, tableName);
private void accessDbToLoadColumns(CaseInsensitiveString tableName) throws SQLException { if (null == _dmd) { s_log.warn(s_stringMgr.getString("SchemaInfo.UnableToLoadColumns", tableName)); return; } String name = getCaseSensitiveTableName(tableName.toString()); TableInfo ti = new TableInfo(null, null, name, "TABLE", null, _dmd); try { TableColumnInfo[] infos = _dmd.getColumnInfo(ti); _schemaInfoCache.writeColumsToCache(infos, tableName); } catch (Throwable th) { _schemaInfoCache.writeColumsNotAccessible(th, tableName); } }
private void accessDbToLoadColumns(CaseInsensitiveString tableName) throws SQLException { if (null == _dmd) { s_log.warn(s_stringMgr.getString("SchemaInfo.UnableToLoadColumns", tableName)); return; } String name = getCaseSensitiveTableName(tableName.toString()); TableInfo ti = new TableInfo(null, null, name, "TABLE", null, _dmd); try { TableColumnInfo[] infos = _dmd.getColumnInfo(ti); _schemaInfoCache.writeColumsToCache(infos, tableName); } catch (Throwable th) { _schemaInfoCache.writeColumsNotAccessible(th, tableName); } }
try colInfoArr = sourceCon.getSQLMetaData().getColumnInfo(ti); } catch (SQLException e)
TableColumnInfo[] columns = _session.getSQLConnection().getSQLMetaData().getColumnInfo(ti);