Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class Datenbank {
- public static void main(String[] args) throws SQLException {
- Connection con = DriverManager.getConnection(
- "jdbc:mysql://localhost:3306/bank");
- Statement an = con.createStatement();
- ResultSet rs = an.executeQuery(
- "Select Kontonummer from konto" + "where name = `Martin`");
- while (rs.next())
- {
- System.out.println(rs.getString("Kontonummer"));
- }
- con.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement