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
| // ******************************************
// Code exemple test4Dconn.java
// par Bin Kobayashi
// ******************************************
import java.sql.*;
import java.util.Properties;
public class test{
public static void main(String[] argv) {
try {
Properties props = new Properties();
props.setProperty("user","");
props.setProperty("password","");
Class.forName("com.fourd.jdbc.DriverImpl");
Driver driver=DriverManager.getDriver("jdbc:4d:127.0.0.1");
Connection conn = driver.connect("jdbc:4d:192.168.12.221:19814", props);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from ETAT_DCL ");
while(rs.next()) {
String s1 = rs.getString("Code");
String s2 = rs.getString("Libelle_F");
System.out.println(s1+"::"+s2);
}
conn.close();
} catch (Exception e) {System.out.println(e);}
}
}
// ******************************************
/*
public class test
{
public static void main(String[] args)
{
System.out.println("Hello world");
}
}*/ |