public static void main(String[] args) throws ClassNotFoundException {
        // TODO code application logic here
        Connection conn = null;
        Statement stat = null;
        ResultSet rs = null;
        try {
            Class.forName("org.h2.Driver");
            conn = DriverManager.getConnection("jdbc:h2:~\\test", "sa", "");
            try {
                stat = conn.createStatement();
            } catch (SQLException ex) {
            }
            rs = stat.executeQuery("select * from COMPOSITION");
            while (rs.next()) {
                System.out.println(rs.getString("TITLE") + "1");
            }
        } catch (SQLException ex) {
            Logger.getLogger(test.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            if (conn != null) {
                try {
                    conn.close();
                    stat.close();
                    rs.close();
                } catch (SQLException ex) {
                    Logger.getLogger(test.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
    }