BJ a tous je ne sais ci quelqun peut m'aider mé c urjent .
je n'arrive pas a me conncter a ma base de donée distant et je ne trouve pas comment entrér l'adresse IP
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
40
41
42
43
44
45
46
47
48
package prog;
 
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.DriverManager;
import com.borland.dbswing.*;
 
public class Conectdb
{
  private static final String accessDBURLPrefix = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
  private static final String accessDBURLSuffix = ";DriverID=22;READONLY=false}";
  private static String drivers = "sun.jdbc.odbc.JdbcOdbcDriver";
 
 
 
 
  public Conectdb()
     {
 
     }
 
 
    static
    {
      try
      {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 
      } catch(ClassNotFoundException e)
      {
          System.out.println("JdbcOdbc Bridge Driver not found!");
      }
     }
 
 
     public static Connection getAccessDBConnection(String filename) throws SQLException
     {
 
       filename = filename.replace('\\', '/').trim();
       String databaseURL = accessDBURLPrefix + filename + accessDBURLSuffix;
       return DriverManager.getConnection(databaseURL, "", "");
 
 
     }
 
 
 
}