Java 2 old Papers Solution 2017 || BIM STUDY NOTES

Year 2017 Group B 2.Write a program to display records from the table “employee” that contains (id, name, post and salary) inside the database “testdb”. import java.sql.*; public class Ques2_2017 { public static void main(String[] args) { String url = “jdbc:mysql://localhost:3306/testdb”; String uname = “root”; String pwd = “”; try { Class.forName(“com.mysql.jdbc.Driver”); Connection con = […]

Continue Reading

Java old Papers Solution 2016 || BIM STUDY NOTES

Year 2016 Group B   Q.no 2 Write a swing program to add two numbers given as input by user. import java.awt.*; import javax.swing.*; import javax.swing.event.*; import java.awt.event.*; public class T2016_2 extends JFrame implements ActionListener{ JTextField t1,t2; JLabel sum; JButton b; public T2016_2(){ t1=new JTextField(); t2=new JTextField(); sum=new JLabel(“”); b=new JButton(“Add”); setLayout(new GridLayout(4,1)); add(t1); add(t2); add(b); […]

Continue Reading