Database Operations are similar, such as mysql, oracle, and sqlserve operations.
The first step is to load the driver package.
Step 2: connect to the database through the connection path
Step 3 is the operation .. The following is basically the same:
For example, the Process Code for connecting to the oracle11g database in java
First, load the driver package and find the ojdbc6.jar package in the app \ tao \ product \ 11.2.0 \ dbhome_1 \ jdbc \ lib path under the oracle11g installation directory to your workspace building> private final String NAME = "scott "; // Database Name
Private> private Connection conn = null; // Connection object
Private PreparedStatement> private ResultSet rs = null; // The queried object.
/**
* @ Param>} catch (SQLException e ){
// TODO Auto-generated> try {
Pr = conn. prepareStatement ("select *> while (rs. next ()){//
Str = rs. getInt (1) + "";
Str = str + rs. getString (2) + "";
Str = str + rs. getString (3) + "";
Str = str + rs. getString (4) + "";
Str = str + rs. getDate (5) + "";
Str = str + rs. getString (6) + "";
Str = str + rs. getDate (7) + "";
Str = str + rs. getInt (8) + "";
Str = str + rs. getString (9) + "";
}
}> Da. connection (); // call a function to operate the database
}
}
The oracle database is connected, and you can operate the database ....