An Example ConnectionThe following example shows a code excerpt that illustrates loading the driver and connecting to the default server and database. The following example uses the form of DriverManager.GetConnection() that takes authentication information as a single Properties object. Example Loading the JDBC Driver and Connecting to a Database
String userid = "ADMIN"; String passwd = "ADMIN";
Class.forName ("ctree.jdbc.ctreeDriver");
// of the registered drivers will be loaded until // one is found that can process this URL. java.util.Properties prop = new java.util.Properties(); prop.put("user", userid);
prop.put("password", passwd);
|
|||