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; }
public Icon getIcon() { return _dboInfo.getDatabaseObjectType().getIcon(); }
/** * * @param sourceConn * @param ti * @return * @throws SQLException */ public static int getColumnCount(ISQLConnection sourceConn, ITableInfo ti) throws SQLException { return sourceConn.getSQLMetaData().getColumnInfo(ti).length; }
/** * * @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(); }
public String getCatalogName() { if (null != _objectTreeNode) { return _objectTreeNode.getDatabaseObjectInfo().getCatalogName(); } else { return _tableInfo.getCatalogName(); } }
private String[] getSimpleNames(ITableInfo[] tableInfos) { String[] result = new String[tableInfos.length]; for (int i = 0; i < result.length; i++) { result[i] = tableInfos[i].getSimpleName(); } return result; }
private void _closeStatement() { try { SQLUtilities.closeStatement(_statement); } finally { _statement = null; } }
public static void main(String[] args) { //some data String catalog = null; String schema = "public"; String employeIdentifactionTable = "EmployeeIdentification"; String[] employeeColumns = {"EmployeeNumber", "Name", "PhoneNumber"}; TableColumnInfo newColumn = new TableColumnInfo( catalog, schema, employeIdentifactionTable, employeeColumns[0], Types.VARCHAR, JDBCTypeMapper.getJdbcTypeName(Types.VARCHAR), 30, 0, 0, 1, null, null, 0, 1, "YES"); new AddAutoIncrementDialog(newColumn, null).setVisible(true); }
/** * hides the progress dialog. */ public void hideProgressDialog() { cb.setVisible(false); cb.dispose(); }
/** * Retrieve the MySQL command to run. * * * @return the MySQL command to run. */ protected String getMySQLCommand(IDatabaseObjectInfo dbObj) { return "explain " + dbObj.getQualifiedName(); } }
public void run() { _cb.setVisible(false); } });
/** * @see net.sourceforge.squirrel_sql.client.session.ISession#getMetaData() */ public ISQLDatabaseMetaData getMetaData() { if (_conn != null) { return _conn.getSQLMetaData(); } else { return null; } }
/** * Hide the progress monitor. * The progress monitor will not be destroyed. */ protected void hideProgressMonitor() { if(progressDialog != null){ progressDialog.setVisible(false); progressDialog.dispose(); } }
@Override protected IDataSet getUnfilteredDataSet(SQLDatabaseMetaData md, ITableInfo tableInfo) throws DataSetException { return md.getImportedKeysDataSet(tableInfo); } }
@Override protected IDataSet getUnfilteredDataSet(SQLDatabaseMetaData md, ITableInfo tableInfo) throws DataSetException { return md.getExportedKeysDataSet(tableInfo); } }
/** * @see net.sourceforge.squirrel_sql.client.session.DefaultSQLExecuterHandler#sqlStatementCount(int) */ @Override public void sqlStatementCount(final int statementCount) { cb.setTotalItems(statementCount); }
/** * Check, if the user has canceled the task. * @return true, if the user has canceled the task, otherwise false. */ protected boolean isAborted() { if(progressDialog != null && progressDialog.isStop()){ return true; } return false; } }
/** * * @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(); }
protected String getFirstColumnName(ITableInfo ti) throws SQLException { TableColumnInfo[] infos = _session.getSQLConnection().getSQLMetaData().getColumnInfo(ti); return infos[0].getColumnName(); }
protected int getFirstColumnType(ITableInfo ti) throws SQLException { TableColumnInfo[] infos = _session.getSQLConnection().getSQLMetaData().getColumnInfo(ti); return infos[0].getDataType(); }