Java Code Examples for java.sql.Connection.getMetaData()

The following are Jave code examples for showing how to use getMetaData() of the java.sql.Connection class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenVertretung   File: MetadataTest.java   View Source Code Vote up 7 votes
/**
 * Tests the implementation of Information Schema for description
 * of stored procedures available in a catalog.
 */
public void testGetProceduresUsingInfoSchema() throws Exception {
    if (versionMeetsMinimum(5, 0, 7)) {
        createProcedure("sp1", "()\n BEGIN\nSELECT 1;end\n");
        Properties props = new Properties();
        props.put("useInformationSchema", "true");
        Connection conn1 = null;
        try {
            conn1 = getConnectionWithProps(props);
            DatabaseMetaData metaData = conn1.getMetaData();
            this.rs = metaData.getProcedures(null, null, "sp1");
            this.rs.next();
            assertEquals("sp1", this.rs.getString("PROCEDURE_NAME"));
            assertEquals("1", this.rs.getString("PROCEDURE_TYPE"));
        } finally {
            if (conn1 != null) {
                conn1.close();
            }
        }
    }
}
 
Example 2
Project: BibliotecaPS   File: MetaDataRegressionTest.java   View Source Code Vote up 6 votes
private void checkGetFunctionsForBug69298(String stepDescription, Connection testConn) throws Exception {
    DatabaseMetaData testDbMetaData = testConn.getMetaData();
    ResultSet functionsMD = testDbMetaData.getFunctions(null, null, "testBug69298_%");
    String sd = stepDescription + " getFunctions() ";

    assertTrue(sd + "one row expected.", functionsMD.next());

    // function: testBug69298_func
    assertEquals(sd + "-> FUNCTION_CAT", testConn.getCatalog(), functionsMD.getString("FUNCTION_CAT"));
    assertEquals(sd + "-> FUNCTION_SCHEM", null, functionsMD.getString("FUNCTION_SCHEM"));
    assertEquals(sd + "-> FUNCTION_NAME", "testBug69298_func", functionsMD.getString("FUNCTION_NAME"));
    assertEquals(sd + "-> REMARKS", "testBug69298_func comment", functionsMD.getString("REMARKS"));
    assertEquals(sd + "-> FUNCTION_TYPE", DatabaseMetaData.functionNoTable, functionsMD.getShort("FUNCTION_TYPE"));
    assertEquals(sd + "-> SPECIFIC_NAME", "testBug69298_func", functionsMD.getString("SPECIFIC_NAME"));

    assertFalse(stepDescription + "no more rows expected.", functionsMD.next());
}
 
Example 3
Project: incubator-netbeans   File: DefaultDBProvider.java   View Source Code Vote up 6 votes
public boolean columnInIndex(Connection conn, String schemaName, String tableName, String colname, String indexName)
        throws Exception {
    DatabaseMetaData md = conn.getMetaData();
    ResultSet rs = md.getIndexInfo(null, schemaName, tableName, false, false);

    while ( rs.next() ) {
        String ixName = rs.getString(6);
        if ( ixName != null && ixName.equals(indexName)) {
            String ixColName = rs.getString(9);
            if ( ixColName.equals(colname) ) {
                return true;
            }
        }
    }

    return false;
    
}
 
Example 4
Project: ProyectoPacientes   File: MetadataTest.java   View Source Code Vote up 6 votes
/**
 * Tests the implementation of Information Schema for primary keys.
 */
public void testGetPrimaryKeysUsingInfoShcema() throws Exception {
    if (versionMeetsMinimum(5, 0, 7)) {
        createTable("t1", "(c1 int(1) primary key)");
        Properties props = new Properties();
        props.put("useInformationSchema", "true");
        Connection conn1 = null;
        try {
            conn1 = getConnectionWithProps(props);
            DatabaseMetaData metaData = conn1.getMetaData();
            this.rs = metaData.getPrimaryKeys(null, null, "t1");
            this.rs.next();
            assertEquals("t1", this.rs.getString("TABLE_NAME"));
            assertEquals("c1", this.rs.getString("COLUMN_NAME"));
        } finally {
            if (conn1 != null) {
                conn1.close();
            }
        }
    }
}
 
Example 5
Project: kinetica-client-jdbc   File: JDBCSample.java   View Source Code Vote up 6 votes
/**
 * Retrieves a description of all the data types supported by the data
 * source.
 * 
 * @param conn
 *            The connection used to list the data types.
 * @throws SQLException
 *             if error happens while querying the data source.
 */
private static void showDataTypes(Connection conn) throws SQLException {
	assert (conn != null);

	DatabaseMetaData meta = conn.getMetaData();

	ResultSet result = null;
	try {
		result = meta.getTypeInfo();
		printResultSet(result);
	} finally {
		if (result != null) {
			result.close();
		}
	}
}
 
Example 6
Project: sample.daytrader3   File: TradeDirect.java   View Source Code Vote up 6 votes
public String checkDBProductName() throws Exception {
	Connection conn = null;
	String dbProductName = null;

	try {
		if (Log.doTrace())
			Log.traceEnter("TradeDirect:checkDBProductName");

		conn = getConn();
		DatabaseMetaData dbmd = conn.getMetaData();
		dbProductName = dbmd.getDatabaseProductName();
	} catch (SQLException e) {
		Log
				.error(
						e,
						"TradeDirect:checkDBProductName() -- Error checking the Daytrader Database Product Name");
	} finally {
		releaseConn(conn);
	}
	return dbProductName;
}
 
Example 7
Project: QDrill   File: Drill2489CallsAfterCloseThrowExceptionsTest.java   View Source Code Vote up 6 votes
@BeforeClass
public static void setUpConnection() throws Exception {
  // (Note: Can't use JdbcTest's connect(...) for this test class.)
  final Connection connection =
      new Driver().connect( "jdbc:drill:zk=local", JdbcAssert.getDefaultProperties() );
  final Statement stmt = connection.createStatement();
  final ResultSet result =
      stmt.executeQuery( "SELECT * FROM INFORMATION_SCHEMA.CATALOGS" );
  result.next();
  final DatabaseMetaData dbmd = connection.getMetaData();

  result.close();
  closedResultSet = result;
  stmt.close();
  closedStatement = stmt;
  connection.close();
  closedConnection = connection;
  closedDatabaseMetaData = dbmd;
}
 
Example 8
Project: OpenVertretung   File: MetaDataRegressionTest.java   View Source Code Vote up 6 votes
public void testBug31187() throws Exception {
    createTable("testBug31187", "(field1 int)");

    Connection nullCatConn = getConnectionWithProps("nullCatalogMeansCurrent=false");
    DatabaseMetaData dbmd = nullCatConn.getMetaData();
    ResultSet dbTblCols = dbmd.getColumns(null, null, "testBug31187", "%");

    boolean found = false;

    while (dbTblCols.next()) {
        String catalog = dbTblCols.getString("TABLE_CAT");
        String table = dbTblCols.getString("TABLE_NAME");
        boolean useLowerCaseTableNames = dbmd.storesLowerCaseIdentifiers();

        if (catalog.equals(nullCatConn.getCatalog())
                && (((useLowerCaseTableNames && "testBug31187".equalsIgnoreCase(table)) || "testBug31187".equals(table)))) {
            found = true;
        }
    }

    assertTrue("Didn't find any columns for table named 'testBug31187' in database " + this.conn.getCatalog(), found);
}
 
Example 9
Project: ProyectoPacientes   File: MetaDataRegressionTest.java   View Source Code Vote up 6 votes
private void checkGetFunctionsForBug69298(String stepDescription, Connection testConn) throws Exception {
    DatabaseMetaData testDbMetaData = testConn.getMetaData();
    ResultSet functionsMD = testDbMetaData.getFunctions(null, null, "testBug69298_%");
    String sd = stepDescription + " getFunctions() ";

    assertTrue(sd + "one row expected.", functionsMD.next());

    // function: testBug69298_func
    assertEquals(sd + "-> FUNCTION_CAT", testConn.getCatalog(), functionsMD.getString("FUNCTION_CAT"));
    assertEquals(sd + "-> FUNCTION_SCHEM", null, functionsMD.getString("FUNCTION_SCHEM"));
    assertEquals(sd + "-> FUNCTION_NAME", "testBug69298_func", functionsMD.getString("FUNCTION_NAME"));
    assertEquals(sd + "-> REMARKS", "testBug69298_func comment", functionsMD.getString("REMARKS"));
    assertEquals(sd + "-> FUNCTION_TYPE", DatabaseMetaData.functionNoTable, functionsMD.getShort("FUNCTION_TYPE"));
    assertEquals(sd + "-> SPECIFIC_NAME", "testBug69298_func", functionsMD.getString("SPECIFIC_NAME"));

    assertFalse(stepDescription + "no more rows expected.", functionsMD.next());
}
 
Example 10
Project: bdf2   File: ExcelModelManager.java   View Source Code Vote up 6 votes
public List<String> findTablePrimaryKeys(String dataSourceName, String tableName) throws Exception {
	List<String> primaryKeys = new ArrayList<String>();
	Connection conn = null;
	ResultSet rs = null;
	try {
		conn = connectionHelper.getConnection(dataSourceName);
		DatabaseMetaData metaData = conn.getMetaData();
		rs = metaData.getPrimaryKeys(null, null, tableName.toUpperCase());
		while (rs.next()) {
			primaryKeys.add(rs.getString("COLUMN_NAME").toLowerCase());
		}
		return primaryKeys;
	} finally {
		if (conn != null) {
			conn.close();
		}
		if (rs != null) {
			rs.close();
		}
	}
}
 
Example 11
Project: github-test   File: DatabaseStatusChecker.java   View Source Code Vote up 5 votes
public Status check() {
    boolean ok;
    try {
        Connection connection = dataSource.getConnection();
        try {
            DatabaseMetaData metaData = connection.getMetaData();
            ResultSet resultSet = metaData.getTypeInfo();
            try {
                ok = resultSet.next();
            } finally {
                resultSet.close();
            }
            if (message == null) {
                message = metaData.getURL()
                        + " (" + metaData.getDatabaseProductName()
                        + " " + metaData.getDatabaseProductVersion()
                        + ", " + getIsolation(metaData.getDefaultTransactionIsolation()) + ")";
            }
            if (version == 0) {
                version = metaData.getDatabaseMajorVersion();
            }
        } finally {
            connection.close();
        }
    } catch (Throwable e) {
        logger.error(e.getMessage(), e);
        ok = false;
    }
    return new Status(!ok ? Status.Level.ERROR : (version < 5 ? Status.Level.WARN : Status.Level.OK), message);
}
 
Example 12
Project: aceql-http   File: JsonDatabaseMetaDataTest.java   View Source Code Vote up 5 votes
/**
    * @param args
    */
   public static void main(String[] args) throws Exception {

Connection connection = ConnectionLoader.getLocalConnection();
DatabaseMetaData databaseMetaData = connection.getMetaData();

JsonDatabaseMetaData jsonDatabaseMetaData = new JsonDatabaseMetaData(
	databaseMetaData);
String JsonString = jsonDatabaseMetaData.build();
System.out.println(JsonString);

   }
 
Example 13
Project: alfresco-repository   File: ExportDb.java   View Source Code Vote up 5 votes
private void execute(Connection con, int schemaVersion) throws Exception
{
    final DatabaseMetaData dbmd = con.getMetaData();

    String schemaName = databaseMetaDataHelper.getSchema(con);

    schema = new Schema(schemaName, namePrefix, schemaVersion, true);
    String[] prefixFilters = namePrefixFilters(dbmd);
    
    for (String filter : prefixFilters)
    {
        extractSchema(dbmd, schemaName, filter);
    }
}
 
Example 14
Project: gmds   File: Main.java   View Source Code Vote up 5 votes
public static void main(String[] args) {
    Connection conn = null;
    DatabaseMetaData dbmd;
    try {
        conn = DriverManager.getConnection(URL);
        dbmd = conn.getMetaData();
        if (dbmd != null) {
            ObjectJson builder = new ObjectJson();
            
            builder.addDoc("URL", dbmd.getURL());
            builder.addDoc("DatabaseProductVersion", dbmd.getDatabaseProductVersion());
            builder.addDoc("DriverName", dbmd.getDriverName());
         
            System.out.println(new Map2JsonString().convert(builder.getObjectAsMap()));
            System.out.println("\n");
            
            printTableMeta(conn, dbmd);

        } else {
            System.out.println("Metadata not supported");
        }
    } catch (SQLException ex1) {
        System.err.println(ex1);
    } finally {
        try {
            conn.close();
        } catch (SQLException ex2) {

        }
    }
}
 
Example 15
Project: Locked   File: SQLUtil.java   View Source Code Vote up 5 votes
public static boolean tableExists(SQLConnection connection, String table) throws ClassNotFoundException, SQLException {
    checkAndOpen(connection);
    Connection c = connection.getConnection();
    DatabaseMetaData metaData = c.getMetaData();
    ResultSet rs = metaData.getTables(null, null, table, null);
    if (rs.next()) {
        return rs.getRow() == 1;
    }
    return false;
}
 
Example 16
Project: the-vigilantes   File: MetaDataRegressionTest.java   View Source Code Vote up 5 votes
private void checkMetaDataInfoForBug17248345(Connection testConn) throws Exception {
    DatabaseMetaData testDbMetaData = testConn.getMetaData();
    ResultSet rsMD;
    boolean useInfoSchema = ((ConnectionProperties) testConn).getUseInformationSchema();
    boolean getProcRetFunc = ((ConnectionProperties) testConn).getGetProceduresReturnsFunctions();
    String stepDescription = "Prop. useInfoSchema(" + (useInfoSchema ? 1 : 0) + ") + getProcRetFunc(" + (getProcRetFunc ? 1 : 0) + "):";
    String sd;

    // getProcedures() must return 2 records, even if getProceduresReturnsFunctions is false once this flag only
    // applies to JDBC4. When exists a procedure and a function with same name, function is returned first.
    sd = stepDescription + " getProcedures() ";
    rsMD = testDbMetaData.getProcedures(null, null, "testBug17248345");
    assertTrue(sd + "1st of 2 rows expected.", rsMD.next());
    assertEquals(sd + " -> PROCEDURE_NAME", "testBug17248345", rsMD.getString("PROCEDURE_NAME"));
    assertTrue(sd + "2nd of 2 rows expected.", rsMD.next());
    assertEquals(sd + " -> PROCEDURE_NAME", "testBug17248345", rsMD.getString("PROCEDURE_NAME"));
    assertFalse(sd + "no more rows expected.", rsMD.next());

    // getProcedureColumns() must return 3 records, even if getProceduresReturnsFunctions is false once this flag
    // only applies to JDBC4. When exists a procedure and a function with same name, function is returned first.
    sd = stepDescription + " getProcedureColumns() ";
    rsMD = testDbMetaData.getProcedureColumns(null, null, "testBug17248345", "%");
    assertTrue(sd + "1st of 3 rows expected.", rsMD.next());
    assertEquals(sd + " -> PROCEDURE_NAME", "testBug17248345", rsMD.getString("PROCEDURE_NAME"));
    assertEquals(sd + " -> COLUMN_NAME", "", rsMD.getString("COLUMN_NAME"));
    assertTrue(sd + "2nd of 3 rows expected.", rsMD.next());
    assertEquals(sd + " -> PROCEDURE_NAME", "testBug17248345", rsMD.getString("PROCEDURE_NAME"));
    assertEquals(sd + " -> COLUMN_NAME", "funccol", rsMD.getString("COLUMN_NAME"));
    assertTrue(sd + "3rd of 3 rows expected.", rsMD.next());
    assertEquals(sd + " -> PROCEDURE_NAME", "testBug17248345", rsMD.getString("PROCEDURE_NAME"));
    assertEquals(sd + " -> COLUMN_NAME", "proccol", rsMD.getString("COLUMN_NAME"));
    assertFalse(sd + "no more rows expected.", rsMD.next());
}
 
Example 17
Project: EatDubbo   File: DatabaseStatusChecker.java   View Source Code Vote up 5 votes
public Status check() {
    boolean ok;
    try {
        Connection connection = dataSource.getConnection();
        try {
            DatabaseMetaData metaData = connection.getMetaData();
            ResultSet resultSet = metaData.getTypeInfo();
            try {
                ok = resultSet.next();
            } finally {
                resultSet.close();
            }
            if (message == null) {
                message = metaData.getURL()
                    + " (" + metaData.getDatabaseProductName() 
                    + " " + metaData.getDatabaseProductVersion()
                    + ", " + getIsolation(metaData.getDefaultTransactionIsolation()) + ")";
            }
            if (version == 0) {
                version = metaData.getDatabaseMajorVersion();
            }
        } finally {
            connection.close();
        }
    } catch (Throwable e) {
        logger.error(e.getMessage(), e);
        ok = false;
    }
    return new Status(! ok ? Status.Level.ERROR : (version < 5 ? Status.Level.WARN : Status.Level.OK), message);
}
 
Example 18
Project: vertx-generator   File: DBUtil.java   View Source Code Vote up 4 votes
/**
 * 获得所有列同时生成Attribute表模型
 * 
 * @param config
 * @param tableName
 * @return
 * @throws Exception
 */
public static List<AttributeCVF> getTableColumns(DatabaseConfig config, String tableName) throws Exception {
	Connection conn = getConnection(config);
	DatabaseMetaData md = conn.getMetaData();
	ResultSet rs = md.getColumns(null, null, tableName, null);
	Map<String, AttributeCVF> columnMap = new HashMap<>();
	while (rs.next()) {
		AttributeCVF attribute = new AttributeCVF();
		attribute.setConlumn(rs.getString("COLUMN_NAME"));
		attribute.setComment(rs.getString("REMARKS"));
		attribute.setJavaType(JavaType.jdbcTypeToJavaType(rs.getString("TYPE_NAME")));
		attribute.setJdbcType(rs.getString("TYPE_NAME").toUpperCase());
		attribute.setColumnSize(rs.getInt("COLUMN_SIZE"));
		attribute.setColumnDefult(rs.getString("COLUMN_DEF"));
		attribute.setNullable(rs.getInt("NULLABLE") == 0 ? false : true);
		columnMap.put(rs.getString("COLUMN_NAME"), attribute);
	}
	if (columnMap.size() == 0) {
		throw new NullPointerException("从表中获取字段失败!获取不到任何字段!");
	}
	List<AttributeCVF> result = new ArrayList<>(columnMap.values());
	// 将主键放在第一位
	String key = null;
	key = getTablePrimaryKey(config, tableName);
	if (key != null) {
		boolean anyKeyInFrist = false;
		if (result.size() > 0) {
			if (result.get(0).getConlumn() != null) {
				if (result.get(0).getConlumn().equals(key)) {
					anyKeyInFrist = true;
				}
			}
		}
		if (!anyKeyInFrist) {
			int keyIndex = 0;
			for (int i = 0; i < result.size(); i++) {
				if (result.get(i).getConlumn() != null) {
					if (result.get(i).getConlumn().equals(key)) {
						keyIndex = i;
						break;
					}
				}
			}
			result.add(0, result.remove(keyIndex));
		}
	}

	return result;
}
 
Example 19
Project: bdf2   File: QueryWizardPR.java   View Source Code Vote up 4 votes
@DataProvider
public Collection<ColumnDef> loadTableColumns(String tableName) throws Exception{
	if(tableName==null)return null;
	Collection<ColumnDef> result=new ArrayList<ColumnDef>();
	DataSource ds=this.getJdbcTemplate().getDataSource();
	Connection con = DataSourceUtils.getConnection(ds);
	Statement stmt = null;
	ResultSet rs=null;
	try{
		con = DataSourceUtils.getConnection(ds);
		DatabaseMetaData databaseMetaData=con.getMetaData();
		stmt = con.createStatement();
		rs = stmt.executeQuery("select * from "+tableName);
		ResultSetMetaData rsmd = rs.getMetaData();
		int count = rsmd.getColumnCount();
		for (int i = 1; i <= count; i++) {
			ColumnDef col=new ColumnDef();
			col.setTableName(tableName);
			col.setName(rsmd.getColumnName(i));
			int columnType=rsmd.getColumnType(i);
			String type="String";
			if(columnType==Types.INTEGER || columnType ==Types.BIGINT || columnType==Types.SMALLINT || columnType==Types.TINYINT){
				type="int";
			}else if(columnType==Types.BOOLEAN){
				type="Boolean";
			}else if(columnType==Types.DATE){
				type="Date";
			}else if(columnType==Types.TIMESTAMP){
				type="DateTime";
			}else if(columnType==Types.TIME){
				type="Time";
			}else if(columnType==Types.DECIMAL || columnType==Types.NUMERIC){
				type="BigDecimal";
			}else if(columnType==Types.FLOAT){
				type="Float";
			}else if(columnType==Types.DOUBLE){
				type="double";
			}
			col.setLabel(getColumnRemarks(col.getTableName(),col.getName(),databaseMetaData));
			col.setType(type);
			result.add(col);
		}	
	}finally{
		JdbcUtils.closeResultSet(rs);
		JdbcUtils.closeStatement(stmt);
		JdbcUtils.closeConnection(con);
	}
	return result;
}
 
Example 20
Project: ProyectoPacientes   File: MetaDataRegressionTest.java   View Source Code Vote up 4 votes
private void testTimestamp(Connection con, Statement st, String dbname) throws SQLException {
    st.execute("DROP  TABLE IF EXISTS testBug63800");
    st.execute("CREATE TABLE testBug63800(f1 TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)");
    DatabaseMetaData dmd = con.getMetaData();
    this.rs = dmd.getVersionColumns(dbname, dbname, "testBug63800");
    assertTrue("1 column must be found", this.rs.next());
    assertEquals("Wrong column or single column not found", this.rs.getString(2), "f1");

    st.execute("DROP  TABLE IF EXISTS testBug63800");
    st.execute("CREATE TABLE testBug63800(f1 TIMESTAMP)");
    dmd = con.getMetaData();
    this.rs = dmd.getVersionColumns(dbname, dbname, "testBug63800");
    assertTrue("1 column must be found", this.rs.next());
    assertEquals("Wrong column or single column not found", this.rs.getString(2), "f1");

    st.execute("DROP  TABLE IF EXISTS testBug63800");
    st.execute("CREATE TABLE testBug63800(f1 TIMESTAMP DEFAULT CURRENT_TIMESTAMP)");
    dmd = con.getMetaData();
    this.rs = dmd.getVersionColumns(dbname, dbname, "testBug63800");
    assertFalse("0 column must be found", this.rs.next());

    st.execute("DROP  TABLE IF EXISTS testBug63800");
    st.execute("CREATE TABLE testBug63800(f1 TIMESTAMP DEFAULT 0)");
    dmd = con.getMetaData();
    this.rs = dmd.getVersionColumns(dbname, dbname, "testBug63800");
    assertFalse("0 column must be found", this.rs.next());

    st.execute("DROP  TABLE IF EXISTS testBug63800");
    st.execute("CREATE TABLE testBug63800(f1 TIMESTAMP DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP)");
    dmd = con.getMetaData();
    this.rs = dmd.getVersionColumns(dbname, dbname, "testBug63800");
    assertTrue("1 column must be found", this.rs.next());
    assertEquals("Wrong column or single column not found", this.rs.getString(2), "f1");

    st.execute("DROP  TABLE IF EXISTS testBug63800");
    st.execute("CREATE TABLE testBug63800(f1 TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP)");
    dmd = con.getMetaData();
    this.rs = dmd.getVersionColumns(dbname, dbname, "testBug63800");
    assertTrue("1 column must be found", this.rs.next());
    assertEquals("Wrong column or single column not found", this.rs.getString(2), "f1");

    st.execute("DROP  TABLE IF EXISTS testBug63800");
    st.execute("CREATE TABLE testBug63800(f1 TIMESTAMP NULL, f2 TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP)");
    dmd = con.getMetaData();
    this.rs = dmd.getVersionColumns(dbname, dbname, "testBug63800");
    assertTrue("1 column must be found", this.rs.next());
    assertEquals("Wrong column or single column not found", this.rs.getString(2), "f2");

    // ALTER test
    st.execute("ALTER TABLE testBug63800 CHANGE COLUMN `f2` `f2` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', "
            + "ADD COLUMN `f3` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP  AFTER `f2`");
    dmd = con.getMetaData();
    this.rs = dmd.getVersionColumns(dbname, dbname, "testBug63800");
    assertTrue("1 column must be found", this.rs.next());
    assertEquals("Wrong column or single column not found", this.rs.getString(2), "f3");
}