\begin{sql}
import java.sql.*; \\
class jdbcCities \{ \\
  public static void main (String args []) \\
\>\>\>throws SQLException \{ \\
\>// \Oracle-Treiber laden \\
\>{\green DriverManager}.{\red registerDriver} \\
\>\>\>    (new oracle.jdbc.driver.OracleDriver()); \\
\>// Verbindung zur Datenbank herstellen \\
\>{\gray String} url = \\
\>\>
    \verb|"|jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:dbis\verb|"|; \\
\>{\gray Connection} {\blue conn} = \\
\>\>
    {\green DriverManager}.{\blue getConnection}(url,\verb|"|scott\verb|"|,\verb|"|tiger\verb|"|); \\
\>// Anfrage an die Datenbank \\
\>{\gray Statement} {\red stmt} = {\blue conn}.{\red createStatement()}; \\
\>{\gray ResultSet} {\magenta rset} = \\
\>\> {\red stmt}.{\magenta executeQuery}%
             (\verb|"|SELECT Name, Population FROM City\verb|"|); \\
\>while ({\magenta rset}.next()) \{\\
\>\>\>   // Verarbeitung der Ergebnismenge \\
\>\>{\green String} s = {\magenta rset}.{\green getString}(1); \\
\>\>{\green int} i = {\magenta rset}.{\green getInt}(\verb|"|Population\verb|"|); \\
\>\>System.out.println (s + \verb|"|  \verb|"| + i + \verb|"|$\backslash$n\verb|"|); \\
\>\>\} \\
\>{\blue conn}.{\red close()}; \\
\> \}\}
\end{sql}
