I am parsing tweets in java and want to store the data to a DB, however i am looking for a java data structure that can store all the retrieved tweets so that they can be later inserted into the DB tables.
The form i want to have is:
|---user---||---tweet---||---date---|
The only i can think of is making a class Row
:
public class Row {
private String user;
private String tweet;
private Date created;
public Row(String user, String tweet, Date created) {
this.user = user;
this.tweet = tweet;
this.created = created;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getTweet() {
return tweet;
}
public void setTweet(String tweet) {
this.tweet = tweet;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
}
and instantiate a Row
object to store every tweet with the set()
methods and use the get()
methods to retrieve the data.
Any tips greatly appreciated, switched to java again after some years in python and these tasks seem really not intuitive compared to beloved pandas :)