Advertisement
Guest User

MySQL test

a guest
Jul 23rd, 2017
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. package me.test.Test;
  2.  
  3. import java.sql.DriverManager;
  4.  
  5. import org.bukkit.plugin.java.JavaPlugin;
  6.  
  7. import com.mysql.jdbc.Connection;
  8.  
  9. public class Test extends JavaPlugin {
  10.  
  11. public static void main(String[] args) {
  12. Connection conn = null;
  13. try{
  14. conn = (Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/database","gebruikersnaam","wachtwoord");
  15.  
  16. if(conn!=null)
  17. {
  18. System.out.println("Verbinding succesvol");
  19. }
  20. }catch(Exception e)
  21. {
  22. System.out.println("Niet verbonden met de database");
  23. }
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement