To get the current Date
SELECT * FROM dbname.tablename where cast(rec_add_dt as Date) ='2020-01-08'
To make the primary key as auto increment
ALTER TABLE db.tablename MODIFY id int NOT NULL AUTO_INCREMENT;
To Create Table
create table db.EXAM_RESULT (
student_name VARCHAR(30) NOT NULL,
dob DATE NOT NULL,
percentage double NOT NULL
);
SELECT * FROM outboundcontact.contactcalldetail;contactcalldetail
Delete FROM outboundcontact.contactcalldetail where idcontactlist=1;
ALTER TABLE outboundcontact.contactcalldetail
Change OriginatorDB OriginatorDN varchar(45);
ALTER TABLE outboundcontact.contactcalldetail
drop column contact_disposition
ALTER TABLE outboundcontact.contactcalldetail
drop column originator_type
ALTER TABLE outboundcontact.contactcalldetail
drop column contact_type
Driver class name for mySQL 8.0 : com.mysql.cj.jdbc.Driver
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
To find the driver
Control+Shift+T and look for Driver class and find the fullyQualified name of the driver
Useful cron expressions
https://www.baeldung.com/cron-expressions
SELECT * FROM dbname.tablename where cast(rec_add_dt as Date) ='2020-01-08'
To make the primary key as auto increment
ALTER TABLE db.tablename MODIFY id int NOT NULL AUTO_INCREMENT;
To Create Table
create table db.EXAM_RESULT (
student_name VARCHAR(30) NOT NULL,
dob DATE NOT NULL,
percentage double NOT NULL
);
SELECT * FROM outboundcontact.contactcalldetail;contactcalldetail
Delete FROM outboundcontact.contactcalldetail where idcontactlist=1;
ALTER TABLE outboundcontact.contactcalldetail
Change OriginatorDB OriginatorDN varchar(45);
ALTER TABLE outboundcontact.contactcalldetail
drop column contact_disposition
ALTER TABLE outboundcontact.contactcalldetail
drop column originator_type
ALTER TABLE outboundcontact.contactcalldetail
drop column contact_type
Driver class name for mySQL 8.0 : com.mysql.cj.jdbc.Driver
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
To find the driver
Control+Shift+T and look for Driver class and find the fullyQualified name of the driver
<second> <minute> <hour> <day-of-month> <month> <day-of-week> <year> <command>@Scheduled(cron = "0 58 12 * * ?")
To run in specific hour of the day0 13,14,15 * * * /home/user/command
Useful cron expressions
https://www.baeldung.com/cron-expressions