

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
THESE ARE SOME BASIC DATABASE LABS ASSIGNMENT EASY FOR BEGINNERS..THEY CONTAIN OUPUT PICS AND CODE AS WELL
Typology: Lab Reports
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Lab# 13 EXCERCISE ( 15 MARKS) Problem 13. Create a java application to display the records of customer and employee tables. try { String dbURL = "jdbc:sqlserver://AYMEN\ SQLEXPRESS:1433;databaseName=Database1"; String user = "sa"; String pass = "123"; conn = DriverManager.getConnection(dbURL, user, pass); Statement st = conn.createStatement(); String sql = "select * from customer " ; ResultSet rs = st.executeQuery(sql); while(rs.next()){ System.out.println(rs) ; } String sql2= "select * from employee" ; ResultSet rs2 = st.executeQuery(sql2); while(rs2.next()){ System.out.println(rs2) ; } } catch (SQLException ex) { ex.printStackTrace(); System.out.println("Oops having some problem in connecting with MS SQL Server"); } Problem 13.