Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

ich sehe den fehler nicht, der bei der compilierung auftritt :/

import java.sql.*;

import java.util.*;

public class SettingsDBAccess {

Connection conn = null;

Statement stmt = null;

ResultSet resultSet = null;

int id;

String vorname = null;

String name = null;

int alter;

String wohnort = null;

try {

// Registrierung des Datenbanktreibers

Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");

String url = "jdbc:db2:KUNDEN";

String query = "select *";

query += " from kunden";

// Öffnen der Datenbankverbindung

conn = DriverManager.getConnection(url,"db2inst1","start");

// Erzeugung des Statementobjektes

stmt = conn.createStatement();

// Speicherung der Ergebnisse

resultSet = stmt.executeQuery(query);

while(resultSet.next()) {

id = (int) resultSet.getint(ID);

vorname = (String) resultSet.getString("Vorname");

name = (String) resultSet.getString("Name");

alter = (int) resultSet.getint(Alter);

wohnort = (String) resultSet.getString("Wohnort");

} // end of while

resultSet.close();

stmt.close();

conn.close();

} // end of try

catch(ClassNotFoundException e) {

System.out.println(e);

} //end of catch

catch(SQLException e) {

System.out.println(e);

} //end of catch

}

hmmm was sagt er denn?

fehler 1 - zeile 10:

illegal start of type

try {

fehler 2 - zeile 45:

<identifier> expected

}

mehr nich

jo währe vieleicht nicht schlächt ne main zu machen :-)

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.