Here you can find the source of searchServerPropertySplitMinutes()
public static String searchServerPropertySplitMinutes()
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Main { private static String DB_URL = "jdbc:mysql://localhost:3306/bettaserver"; private static String DB_USERNAME = "root"; private static String DB_PASSWORD = "123456"; public static String searchServerPropertySplitMinutes() { String result = "5"; Connection con = null;/* w w w . j a v a 2 s . com*/ PreparedStatement pstmt = null; ResultSet rs = null; String sql = "select valor from parametros where chave = ?"; try { con = getConnection(); pstmt = con.prepareStatement(sql); { pstmt.setString(1, "MOVIE_TIME_SLICE"); } rs = pstmt.executeQuery(); if (rs.next()) { result = rs.getString("valor"); } } catch (SQLException e) { e.printStackTrace(); } finally { close(con, pstmt, rs); } return result; } public static Connection getConnection() throws SQLException { return DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD); } public static void close(Connection con, PreparedStatement pstmt, ResultSet rs) { try { if (rs != null) { rs.close(); } if (pstmt != null) { pstmt.close(); } if (con != null) { con.close(); } } catch (SQLException e) { e.printStackTrace(); } } }