I am trying to fetch data from database where date = jdatechooser:
问题 I have a table with a column datetime i want to retrieve data from database where date is specified in jdatechooser but em continously getting error: Cannot make a static reference to the non-static method getDate() from the type JDateChooser Here is the code: public void actionPerformed(ActionEvent e) { Date date = JDateChooser.getDate(); try{ String query = " Select *from Transactions WHERE "+date+"=? "; PreparedStatement pst = con.prepareStatement(query); ResultSet rs = pst.executeQuery();