Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ConnectPkg;
- import java.SQL.*;
- public class ConnectDB{
- public static Statement connecttodatabase(url, USER, pass){
- String DRIVER = "com.mysql.jdbc.Driver";
- Class.forName(DRIVER).newInstance();
- Connection con = NULL;
- Statement state = NULL;
- try{
- String url="jdbc:mysql://dbsrv2.cs.fsu.edu/cop4710t30db?user=cop4710t30&password=brA7he6r";
- con = DriverManager.getConnection(url);
- state = con.createStatement();
- RETURN state;
- }catch(Exception e){
- System.OUT.println(e.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement