Hello, for my master project i downloaded nearly 12millions of tweets through twitter4j api from april up to now with lat - long and language dependent. But at the begining of everything i made a mistake. The mistake is that i defined tweetCreatedTime column as DateTime and when i was listening to twitter stream i inserted time as java.sql.date which makes date like 2016-03-30 00:00:00 so that means i dont have hours and seconds. To fix my mistake i thought to update all records in table, because i have id’s of tweets so i thought i can get created time of each tweet one by one and can update via tweet id. However i have some problems in my code , therefore i need some ticks and helps. Thank you very much…
When i debug my code i faced with a problem in the following part of code.
while (rs.next()) {
String tweetId = rs.getString("tweetId");
status = twitter.showStatus(Long.parseLong(tweetId));
Timestamp ts = new Timestamp(status.getCreatedAt().getTime());
count++;
try {
result = updateTime(tweetId, ts);
if (result) {
System.out.println("Update is Successfull!");
System.out.println("------------------");
}else{System.out.println("No result");}
} catch (Exception ex) {
ex.getMessage();
}
In the following part i m getting tweet id’s from database one by one and then trying to get status of user.
String tweetId = rs.getString(“tweetId”);
status = twitter.showStatus(Long.parseLong(tweetId));
But it only updates the first element of result set then exiting from the while statement. so i have problem in running of this statement (status = twitter.showStatus(Long.parseLong(tweetId));)