Skip to content
Snippets Groups Projects
Commit f12113e8 authored by Maria Hartmann's avatar Maria Hartmann
Browse files

modified

parent 54773273
Branches master
No related tags found
No related merge requests found
......@@ -318,7 +318,7 @@ public class Clean {
for(int i=0; i<str.length();i++){
char sign=str.charAt(i);
if(sign==';'){
str=str.substring(0,i-1)+","+str.substring(i+1);
str=str.substring(0,i-1)+"ß"+str.substring(i+1);
}
}
return str;
......@@ -400,6 +400,7 @@ public class Clean {
}
String tweet_text=values[1];//set remaining variables
String tweet_time=values[4];
tweet_text=tweet_text.replace("ß", ";");
int ID=counter;
int retweet_count=Integer.parseInt(values[7]);
int favorite_count=Integer.parseInt(values[8]);
......@@ -547,33 +548,33 @@ public class Clean {
//------------CREATE the Table-----------------------------tweeter_user---------
// String creat_user="CREATE TABLE tweeter_user (id serial NOT NULL," +
// "handle text NOT NULL, " +
// "PRIMARY KEY (id))";
// stmt2.executeUpdate(creat_user);
String creat_user="CREATE TABLE tweeter_user (id serial NOT NULL," +
"handle text NOT NULL, " +
"PRIMARY KEY (id))";
stmt2.executeUpdate(creat_user);
////------------CREATE the Table-----------------------------tweeter_hashtag---------
// String creat_hashtags="CREATE TABLE hashtags (id serial NOT NULL," +
// "hashtag_text text NOT NULL," +
// "PRIMARY KEY (id))";
// stmt3.executeUpdate(creat_hashtags);
//
String creat_hashtags="CREATE TABLE hashtags (id serial NOT NULL," +
"hashtag_text text NOT NULL," +
"PRIMARY KEY (id))";
stmt3.executeUpdate(creat_hashtags);
//------------Transfer the Table-----------------------------hashTag---------
// for(int i=0; i<size_hashtagList;i++){
// Hashtag tmpHash=hashtagList.get(i);
//
// String ID=Integer.toString(tmpHash.get_hashtag_ID());
// String hashtag_text=tmpHash.get_hashtag_text();
//
//
// String hashtag_SQL="INSERT INTO hashtags(id, hashtag_text)" +
// "VALUES("+ID+",'"+hashtag_text+"')";
// stmt4.executeUpdate(hashtag_SQL);
// }
for(int i=0; i<size_hashtagList;i++){
Hashtag tmpHash=hashtagList.get(i);
String ID=Integer.toString(tmpHash.get_hashtag_ID());
String hashtag_text=tmpHash.get_hashtag_text();
String hashtag_SQL="INSERT INTO hashtags(id, hashtag_text)" +
"VALUES("+ID+",'"+hashtag_text+"')";
stmt4.executeUpdate(hashtag_SQL);
}
//------------Transfer the Table-----------------------------Tweet---------
for(int i=0; i<size_tweetList;i++){
......@@ -613,15 +614,15 @@ public class Clean {
}
//------------Transfer the Table-----------------------------USER---------
// for(int i=0; i<size_userList;i++){
// User tmpUser=userList.get(i);
// String user_id=Integer.toString(tmpUser.user_id);
// String handle=tmpUser.handle;
//
// String user_SQL="INSERT INTO tweeter_user(id, handle)" +
// "VALUES("+user_id+",'"+handle+"')";
// stmt6.executeUpdate(user_SQL);
//
for(int i=0; i<size_userList;i++){
User tmpUser=userList.get(i);
String user_id=Integer.toString(tmpUser.user_id);
String handle=tmpUser.handle;
String user_SQL="INSERT INTO tweeter_user(id, handle)" +
"VALUES("+user_id+",'"+handle+"')";
stmt6.executeUpdate(user_SQL);
//
//
// }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment