-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHomePage.java
More file actions
40 lines (35 loc) · 1.08 KB
/
HomePage.java
File metadata and controls
40 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
public class HomePage {
ArrayList<Post> p;
ArrayList<Feature> f;
Account returnthis(Account a) {
return a;
}
HomePage() throws SQLException{
Connection myconn = DriverManager.getConnection("jdbc:mysql://localhost:3306/Masroka","root","Fucklove7263218000");
Statement mystatement = myconn.createStatement();
ResultSet myRs = mystatement.executeQuery("select * from Masroka.Post");
while(myRs.next()) {
String text = myRs.getString("text");
boolean foundsth = myRs.getBoolean("foundsth");
String username = myRs.getString("UserName");
System.out.println();
System.out.println(username);
System.out.println();
System.out.println(text);
System.out.println();
if(foundsth) {
System.out.println("found sth");
}
else {
System.out.println("search for sth");
}
}
myconn.close();
}
}