According to other people say can make a ride to one of the clear step by step, not as easy to write your own ideas!

1. Even the oracle
The direct use of the oracle are provided give a jar package jdbc: oracle alone is installed, and 10g of oracle on the relative address is:
oracle \ product \ 10.2.0 \ db_2 \ jdbc \ lib \ classes12.jar With this package, java program can directly go to connect oracle database in a specific way as follows:,
Choose Tools: eclipse, if lomboz inserted directly inside look at the table are specific windows - show view-orters-data-database explorer to create a new connection can I use the all-in-one3.3 integrated, at which all-inclusive online can be downloaded for free, open eclipse classes12.jar way to create a new project, such as jdbc, point their right, "build path"
"add external archives" then choose to open up the path above will classes12.jar package into the project, and
Next step is to complete the code: even up this two-step:

Class.forName ( "oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection ( "jdbc: oracle: thin: @ long: 1521: orcl", "user", "password");
A register are driven: the other is not even the Treasury has:
The first sentence is just one of the things into a category of the! He is generally fixed,
The second sentence is to use the host string, what is host string so that it is "jdbc: oracle: thin: @ (host name or ip): 1521: database name"
Of course, if yes try this machine can also be elected at large in brackets (localhost/127.0.0.1) Writing the database behind the user name and password.
In this way, to solve some exception can be connected to the.


The second method: The Bridge: Configure the data source, oracle in oracb10g_homel, TNS server fill in database name inside the parameters of fill will be behind the style of writing, following the same database bridge.

二. Come back to talk about SQL Server 2000 connection:
Bridging the first database in accordance with the affirmative, the database can reset your password, you can not, you will need to set up, no not the used, empty on the trip.
Installed after the database tables built. And is the data likelihood configuration. Control panel, - "Administrative Tools" - "Data Source" - "System DNS" to see it, point to add, find sqlserver can be a very good data, database Here you are automatically well-being of you but one thing we should pay attention If your table is not msger database, here will be configured about the whole thing. After the first point "configuration" the next step, to "change the default database" to the connection that you want to store it. Point to determine OK
Writing procedure is then:
Or that the second sentence, because the database at the data source has been in here do not need to affirm the database, and this is the Class.forName ( "" sun.jdbc.odbc.JdbcOdbcDriver "");
Connection con = DriverManager.getConnection ( "" jdbc: odbc: LocalServer ""[," user "," password "]);
Above on a fixed, I remember on the trip, the following string in, "LocalServer" data source name, you can just go places that search, the latter is optional username, and password, depending on when you have no security set up password,
In this way you can even go up, and
sqlserver the Direct Connect has two kinds of methods (for I now know), The first one is even JTd law, are the second, microsoft even the law (his own life according to package jar name) The first one is to have a JTd . jar package, you can download it online, guided into the package can be had, class.forname () there are to write the Class.forName ( "net.sourceforge.jtds.jdbc.Driver");
conn = DriverManager.getConnection (
"jdbc: jtds: sqlserver: / / localhost: 1433/student", "user", "password");
No. There are three kinds of methods are jar package, are separately mssqlserver.jar msbase.jar msutil.jar three packets must import. To illustrate the point, if you are sp2 of sql server, it must under the download plug-ins, sp3 Bar, the latest is the sp4, a general rule, each security must be equipped with the source version of the do,
The second way is to Class.forName ( "com.microsoft.jdbc.sqlserver.SQLServerDriver");
conn =
DriverManager.getConnection ( "jdbc: microsoft: sqlserver: / / localhost: 1433; DatabaseName = student;
User = user; Password = password ");
Behind it is almost even on the good that嘛,哈哈!

The third database mysql:
Bridging law said not to tomcat Lane;
Direct Connect talk about it. Nets official to the next mysql-connector-java-5.0.4-bin.jar can, and has the distinction version, code examples, we can look at the following
Class.forName ( "com.mysql.jdbc.Driver");
conn = DriverManager.getConnection ( "jdbc: mysql: / / localhost: 3306/mydata1? user = user & password = password");
stmt = conn.createStatement (); also could be the / / "jdbc: mysql: / / localhost / database name", "user", "password"

More ways to have a later addition, it