public Object getFieldValue(_Fields field) { switch (field) { case CONN_ID: return Integer.valueOf(getConnId()); return Byte.valueOf(getDriverType()); return getToken(); return getSchema(); return getTable(); return getTableTypes(); return getColumnName(); return getForeignSchema(); return getForeignTable(); return getProcedureName(); return getFunctionName(); return getAttributeName(); return getTypeName(); return getTypeId();
/** * {@inheritDoc} */ @Override public RowSet getIndexInfo(ServiceMetaDataArgs args, boolean unique, boolean approximate) throws GFXDException { ResultSet rs = null; try { final ConnectionHolder connHolder = getValidConnection(args.connId, args.token); EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); final boolean isODBC = args.getDriverType() == gfxdConstants.DRIVER_ODBC; rs = isODBC ? dmd.getIndexInfoForODBC(null, args.getSchema(), args.getTable(), unique, approximate) : dmd.getIndexInfo(null, args.getSchema(), args.getTable(), unique, approximate); return getRowSet(null, null, rs, INVALID_ID, args.connId, null, 0, false, false, 0, connHolder, true, "getIndexInfo"); } catch (Throwable t) { cleanupResultSet(rs); throw gfxdException(t); } }
/** * {@inheritDoc} */ @Override public RowSet getUDTs(ServiceMetaDataArgs args, List<GFXDType> types) throws GFXDException { ResultSet rs = null; try { final ConnectionHolder connHolder = getValidConnection(args.connId, args.token); EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); int[] sqlTypes = null; if (types != null && !types.isEmpty()) { sqlTypes = new int[types.size()]; for (int index = 0; index < types.size(); index++) { sqlTypes[index] = Converters.getJdbcType(types.get(index)); } } rs = dmd.getUDTs(null, args.getSchema(), args.getTypeName(), sqlTypes); return getRowSet(null, null, rs, INVALID_ID, args.connId, null, 0, false, false, 0, connHolder, true, "getUDTs"); } catch (Throwable t) { cleanupResultSet(rs); throw gfxdException(t); } }
/** * {@inheritDoc} */ @Override public RowSet getBestRowIdentifier(ServiceMetaDataArgs args, int scope, boolean nullable) throws GFXDException { ResultSet rs = null; try { final ConnectionHolder connHolder = getValidConnection(args.connId, args.token); EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); final boolean isODBC = args.getDriverType() == gfxdConstants.DRIVER_ODBC; rs = isODBC ? dmd.getBestRowIdentifierForODBC(null, args.getSchema(), args.getTable(), scope, nullable) : dmd.getBestRowIdentifier(null, args.getSchema(), args.getTable(), scope, nullable); return getRowSet(null, null, rs, INVALID_ID, args.connId, null, 0, false, false, 0, connHolder, true, "getBestRowIdentifier"); } catch (Throwable t) { cleanupResultSet(rs); throw gfxdException(t); } } }
/** * {@inheritDoc} */ @Override public RowSet getUDTs(ServiceMetaDataArgs args, List<GFXDType> types) throws GFXDException { ResultSet rs = null; try { final ConnectionHolder connHolder = getValidConnection(args.connId, args.token); EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); int[] sqlTypes = null; if (types != null && !types.isEmpty()) { sqlTypes = new int[types.size()]; for (int index = 0; index < types.size(); index++) { sqlTypes[index] = Converters.getJdbcType(types.get(index)); } } rs = dmd.getUDTs(null, args.getSchema(), args.getTypeName(), sqlTypes); return getRowSet(null, null, rs, INVALID_ID, args.connId, null, 0, false, false, 0, connHolder, true, "getUDTs"); } catch (Throwable t) { cleanupResultSet(rs); throw gfxdException(t); } }
EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); final boolean isODBC = args.getDriverType() == gfxdConstants.DRIVER_ODBC; switch (schemaCall) { case ATTRIBUTES: rs = dmd.getAttributes(null, args.getSchema(), args.getTypeName(), args.getAttributeName()); break; case CATALOGS: break; case COLUMNPRIVILEGES: rs = dmd.getColumnPrivileges(null, args.getSchema(), args.getTable(), args.getColumnName()); break; case COLUMNS: if (isODBC) { rs = dmd.getColumnsForODBC(null, args.getSchema(), args.getTable(), args.getColumnName()); rs = dmd.getColumns(null, args.getSchema(), args.getTable(), args.getColumnName()); rs = dmd.getCrossReferenceForODBC(null, args.getSchema(), args.getTable(), null, args.getForeignSchema(), args.getForeignTable()); rs = dmd.getCrossReference(null, args.getSchema(), args.getTable(), null, args.getForeignSchema(), args.getForeignTable());
/** * {@inheritDoc} */ @Override public RowSet getIndexInfo(ServiceMetaDataArgs args, boolean unique, boolean approximate) throws GFXDException { ResultSet rs = null; try { final ConnectionHolder connHolder = getValidConnection(args.connId, args.token); EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); final boolean isODBC = args.getDriverType() == gfxdConstants.DRIVER_ODBC; rs = isODBC ? dmd.getIndexInfoForODBC(null, args.getSchema(), args.getTable(), unique, approximate) : dmd.getIndexInfo(null, args.getSchema(), args.getTable(), unique, approximate); return getRowSet(null, null, rs, INVALID_ID, args.connId, null, 0, false, false, 0, connHolder, true, "getIndexInfo"); } catch (Throwable t) { cleanupResultSet(rs); throw gfxdException(t); } }
EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); final boolean isODBC = args.getDriverType() == gfxdConstants.DRIVER_ODBC; switch (schemaCall) { case ATTRIBUTES: rs = dmd.getAttributes(null, args.getSchema(), args.getTypeName(), args.getAttributeName()); break; case CATALOGS: break; case COLUMNPRIVILEGES: rs = dmd.getColumnPrivileges(null, args.getSchema(), args.getTable(), args.getColumnName()); break; case COLUMNS: if (isODBC) { rs = dmd.getColumnsForODBC(null, args.getSchema(), args.getTable(), args.getColumnName()); rs = dmd.getColumns(null, args.getSchema(), args.getTable(), args.getColumnName()); rs = dmd.getCrossReferenceForODBC(null, args.getSchema(), args.getTable(), null, args.getForeignSchema(), args.getForeignTable()); rs = dmd.getCrossReference(null, args.getSchema(), args.getTable(), null, args.getForeignSchema(), args.getForeignTable());
/** * {@inheritDoc} */ @Override public RowSet getBestRowIdentifier(ServiceMetaDataArgs args, int scope, boolean nullable) throws GFXDException { ResultSet rs = null; try { final ConnectionHolder connHolder = getValidConnection(args.connId, args.token); EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); final boolean isODBC = args.getDriverType() == gfxdConstants.DRIVER_ODBC; rs = isODBC ? dmd.getBestRowIdentifierForODBC(null, args.getSchema(), args.getTable(), scope, nullable) : dmd.getBestRowIdentifier(null, args.getSchema(), args.getTable(), scope, nullable); return getRowSet(null, null, rs, INVALID_ID, args.connId, null, 0, false, false, 0, connHolder, true, "getBestRowIdentifier"); } catch (Throwable t) { cleanupResultSet(rs); throw gfxdException(t); } } }