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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started