Headline

Database programming with JDBC and H2-Database containing one or more companies

Characteristics

We use JDBC/SQL for data processing. That is, we use embedded SQL in Java.

Relationships

For a MySQL version see Contribution:mySqlMany.

For a version using SQL "SUM" in Total see Contribution:h2jdbcManySum.

For a version with a database for exactly one company see Contribution:h2jdbcOne.

Illustration

This contribution is using a simple "SELECT" statement returning a set of salaries in Total:

SELECT salary FROM employee
Therefore we need a loop for adding the single salaries

while (salaries.next())
    total += salaries.getDouble("salary");

Architecture

Overview of the Java classes:

  • Total: Using SQL "SELECT" statement to get all salaries, then iterating over the ResultSet.
  • Cut: Using SQL "UPDATE" statement to cut all salaries.
  • Depth: Using SQL "SELECT" statement to get maximum depth of all departments.

Usage

This contribution uses Technology:Gradle for building. Technology:Eclipse is supported.

See https://github.com/101companies/101simplejava/blob/master/README.md


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.