Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Lab2;
- import java.sql.*;
- public class DBCon {
- public static Statement connection() throws SQLException {
- //Statement stmt = null;
- Connection con = null;
- try{
- String url = "jdbc:mysql://mysql25.kontrollpanelen.se/web33476_anders";
- Class.forName("com.mysql.jdbc.Driver");
- con = DriverManager.getConnection(url,"web33476_anders", "DQ81irCs");
- //stmt = con.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
- // java.sql.ResultSet.CONCUR_UPDATABLE);
- }catch(Exception e){
- System.out.println(e);
- }
- //return stmt;
- return con.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
- java.sql.ResultSet.CONCUR_UPDATABLE);
- }
- }
Add Comment
Please, Sign In to add comment