Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user_view(String d1, String d2, String d3) throws ClassNotFoundException, SQLException {
- initComponents();
- int a = Integer.parseInt(d1);
- int b = Integer.parseInt(d2);
- int c = Integer.parseInt(d3);
- int year=a;
- int month=b;
- int date=c;
- String query;
- String query1;
- if(b<=6)
- {
- year=a-1;
- month=b+6;
- query="Select * from user_don_det where Year<="+ year +" and Month<="+ month +"";
- query1="SELECT * FROM `user_det` WHERE `Admission`=(Select Admission From user_don_det where Year<="+ year +" and Month<="+ month +")";
- }
- else
- {
- month=b-6;
- query="Select * from user_don_det where Month<="+ month +" or Year<="+ year +"";
- query1="SELECT * FROM `user_det` WHERE `Admission`=(Select Admission From user_don_det where Month<="+ month +")";
- }
- blooddonation.dbconnectivity db=new blooddonation.dbconnectivity();
- ResultSet rs=db.q_execute(query);
- ResultSet rs1=db.q_execute(query1);
- Vector data=new Vector();
- while(rs.next())
- {
- Vector row=new Vector();
- row.addElement(rs.getInt(1));
- row.addElement(rs.getInt(2));
- row.addElement(rs.getInt(3));
- row.addElement(rs.getInt(4));
- data.addElement(row);
- }
- while(rs1.next())
- {Vector row=new Vector();
- row.addElement(rs1.getString(1));
- row.addElement(rs1.getString(2));
- row.addElement(rs1.getString(6));
- row.addElement(rs1.getInt(8));
- data.addElement(row);
- }
- Vector head=new Vector();
- head.addElement("Admission No");
- head.addElement("Date");
- head.addElement("Month");
- head.addElement("Year");
- head.addElement("Name");
- head.addElement("Email");
- head.addElement("Sex");
- head.addElement("Phone");
- DefaultTableModel model=new DefaultTableModel(data,head);
- tab.setModel(model);
- SEVERE: null
- java.sql.SQLException: Operation not allowed after ResultSet closed
- at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
- at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
- at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
- at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
- at com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:804)
- at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:6986)
- at blooddonation.user_view.<init>(user_view.java:55)
- at blooddonation.user_fscreen$5.actionPerformed(user_fscreen.java:263)
- at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement