Last active
February 18, 2018 22:13
-
-
Save seppenen/d4316fdd2fbaa30bf2e84b62fc427c92 to your computer and use it in GitHub Desktop.
DAO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Dao { | |
public Connection con=null; | |
public ResultSet rs = null; | |
public PreparedStatement stmtPrep=null; | |
public String sql; | |
public Connection yhdista() throws Exception{ | |
Connection con = null; | |
String JDBCAjuri = "org.mariadb.jdbc.Driver"; | |
String url = "jdbc:mariadb://localhost:15001/a1700185"; | |
Class.forName(JDBCAjuri); | |
con = DriverManager.getConnection(url,"a1700185", "pass"); | |
return con; | |
} | |
public void sulje() throws Exception{ | |
if(con!=null){ | |
con.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment