Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void connect()
- {
- long start = System.currentTimeMillis();
- try {
- Class.forName("com.mysql.jdbc.Driver");
- conn = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + name, user, pass);
- plugin.getLogger().info("Nawiazano polaczenie z serwerem MySQL!");
- plugin.getLogger().info("Polaczenie trwalo " + (System.currentTimeMillis() - start) + "ms!");
- } catch (ClassNotFoundException e) {
- plugin.getLogger().warning("Nie znaleziono sterownika JDBC!");
- plugin.getLogger().warning("Blad: " + e.getMessage());
- e.printStackTrace();
- } catch (SQLException e2) {
- plugin.getLogger().warning("Nie mozna nawiazac polaczenia z serwerem MySQL!");
- plugin.getLogger().warning("Blad: " + e2.getMessage());
- e2.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement