comment on peut connaitre le URL
Bonjour
j'essaye de recuperer les donneés des tables Mysql mais je n'ai pas compris comment je pourrai connaitre URL
mon code est
Code:
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
| import java.beans.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
public class essaye1 {
/**
* @param args
* @throws SQLException
*/
public static void main(String[] args) throws SQLException {
// TODO Auto-generated method stub
Connection c= DriverManager.getConnection("jdbc:mysql://localhost;" + "user=abs-009;password=abs-009");
Statement st = (Statement) c.createStatement();
try
{
System.out.println("ssssssssssss");
ResultSet rs = ((java.sql.Statement) st).executeQuery("select * from clients");
while (rs.next()){
System.out.println(rs.getObject("Name"));
System.out.println(rs.getObject("Contact"));
}
}catch(SQLException ex){
System.out.println("erreur SQL");
} |
mais ça ne marche pas !!
merci d'avance :ccool: