I am pulling data from remote sqlserver to local mysql server using jdbc .
In remote sqlserver server I have 2 columns
Name Count
In local mysql I have 3 columns made
Name Count Time_stamp
time_stamp as datetime datatype
I am pulling data using below insert code segment,
while (rs.next()) {
String zoneName = rs.getString("Name");
int zonecount = rs.getInt("Count");
String insertSql = "insert into occupancy.occupancy_phase_2(Name,Count)values('"+zoneName+"',"+zonecount+")";
pstmt = con2.prepareStatement(insertSql);
pstmt.executeUpdate();
I want to add timestamp to the insert query at every run .
How can i do this.