Professional Documents
Culture Documents
University of Melbourne (Semester-2 2011) Department of Computer Science and Software Engineering
University of Melbourne (Semester-2 2011) Department of Computer Science and Software Engineering
University of Melbourne (Semester-2 2011) Department of Computer Science and Software Engineering
Engineering for Internet Applications Lab 4 Tooba Aamir - 396447 1. Manually display the contents of your database/table
Engineering for Internet Applications Lab 4 Tooba Aamir - 396447 2. Copy-and-paste the output of your program for some test cases.
Test cases include first 'insert' of URL ID 5 then 'list' of all table and at end delete' of URL ID 5.
public class Connect { public static void main(String[] args) { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); System.out.println("MySQL Connect Example."); Connection conn = null; String url = "jdbc:mysql://localhost:3306/"; String dbName = "URLCollection"; String driver = "com.mysql.jdbc.Driver"; String userName = "root"; String password = "ciit"; String c = "1"; try { Class.forName(driver); conn = DriverManager.getConnection(url+dbName,userName,password);