I have code which sets an ID value from query :
Connect c=new Connect();
Statement stmt=c.Connstr.createStatement();
ResultSet rs = stmt.executeQuery("select Res_ID,RDate,Receipt,MethodofPayment as 'Installmets?',InstallmentCount as 'Installmets Count',InstallmentStartDate as 'Start',Client_Name as 'Client',Project_Name 'Project',Unit_Name as 'Unit' from reservationwithdetails where Client_ID="+Vars.get_Client_ID()+"");
SearchTable.setModel(buildTableModel(rs));
ResultSet NewRec = stmt.executeQuery(""
+ "select ID from reservation "
+ "where "
+ "Client_ID ="+Vars.get_Client_ID()+" and Project_ID ="+Vars.get_Project_ID()+" and Unit_ID ="+Vars.get_Unit_ID()+"" );
while(NewRec.next()){
Vars.Set_Newest_Reservation_ID(NewRec.getInt("ID"));
}
So, here I give a value for Vars.Set_Newest_Reservation_ID(int ID)
when I call it, I use Vars.Newest_Reservation_ID()
, so I add new wizard jassper report and design the query like this :
SELECT Res_ID, RDate, UnitPrice, ReversationFee, Client_Name, Project_Name, Unit_Name FROM reservationwithdetails
WHERE Res_ID = Vars.Newest_Reservation_ID()
I got an error with this statement form and I know it's wrong ... now how can I make this report query get the Res_ID
Value from external variable?