Question: Consider the JDBC query for the below SQL string , sqlQuery = SELECT * FROM products where created_date > '2020-06-13' and created_date < '2022-07-13' group

Consider the JDBC query for the below SQL string ,

sqlQuery = "SELECT * FROM products where created_date > '2020-06-13' and created_date < '2022-07-13' group by company_id, lq_product" ;

1. Here , write a JDBC query for the created_date > one month back and created_date < today and current time, using the logic given below:

String startDate = Some date util logic giving back date ; // write here the logic for start date to be one month back String endDate = Some date util logic giving current date/time // write here the logic for end date to be current date // And finally the query to be sqlQuery = "SELECT * FROM products where created_date > '+"startDate"+' and created_date < '+"endDate"+' group by company_id, lq_product" ;

2. give the output screenshot of java and also ensure that it works with mysql

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!