Code example for ResultSet

Methods: firstgetString

0
        try { 
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            db_connection = DriverManager.getConnection(url, username, password);
            query = db_connection.createStatement();
            result = query.executeQuery("SELECT * FROM cars");
            result.first();
            System.out.println(result.getString("manufacturer"));
        } catch (SQLException ex) {
            System.out.print(ex);
        } 
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE