Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- download.setOnAction(e -> {
- String userName = "name";
- String password = "pass";
- String connectionURL = "jdbc:mysql://f0203515.xsph.ru:3306/f0205517_apps?useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
- try {
- DriverManager.registerDriver(new com.mysql.cj.jdbc.Driver());
- } catch (SQLException e1) {
- window.close();
- }
- try (Connection connection = DriverManager.getConnection(connectionURL,userName,password);
- Statement statement = connection.createStatement()){
- ResultSet resultSet = statement.executeQuery("SELECT * FROM links");
- while (resultSet.next()){
- //да, говнокод. Но рабочий. Перепилю когда исправлю косяк.
- img[0] = resultSet.getString("link1");
- centerTextField.setText(img[0]);
- centerMenu.getChildren().addAll(centerTextField);
- }
- } catch (SQLException e1) {
- window.close();
- }
- });
Add Comment
Please, Sign In to add comment