-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemp.java
More file actions
38 lines (33 loc) · 1.35 KB
/
temp.java
File metadata and controls
38 lines (33 loc) · 1.35 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
// User user = fbClient.fetchObject("me", User.class);
// Connection<User> myFriends = fbClient.fetchConnection(user.getId()+"/friends", User.class);
// System.out.println(myFriends.getTotalCount());
// for (User friend: myFriends.getData())
// {
// System.out.println(friend.getId());
//
// Connection<Page> myMovies = fbClient.fetchConnection(friend.getId()+"/movies", Page.class);
// String content = "Name:" + friend.getName();
// for (Page movies: myMovies.getData())
// {
// content = content + "\n" + "Movies: "+movies.getName()+"\n";
// }
// System.out.println(content);
//
// }
import java.sql.*;
class MysqlCon
{
public static void main(String args[]){
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection(
"jdbc:mysql://localhost:3306/testdb","root","root");
//here sonoo is database name, root is username and password
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from temp");
while(rs.next())
System.out.println(rs.getInt(1)+" "+rs.getString(2)+" "+rs.getString(3));
con.close();
}catch(Exception e){ System.out.println(e);}
}
}