Connecting to an Oracle Database

原创 2005年06月02日 14:52:00

This example uses an Oracle JDBC driver to connect to an Oracle database instance located at with an sid called mydatabase.

    Connection connection = null;
    try {
        // Load the JDBC driver
        String driverName = "oracle.jdbc.driver.OracleDriver";
        // Create a connection to the database
        String serverName = ;
        String portNumber = ;
        String sid = ;
        String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
        String username = ;
        String password = ;
        connection = DriverManager.getConnection(url, username, password);
    } catch (ClassNotFoundException e) {
        // Could not find the database driver
    } catch (SQLException e) {
        // Could not connect to the database

Connecting to Container Databases (CDB) and Pluggable Databases (PDB) in Oracle Database 12c

Connecting to the root of a container database is the same as that of any previous database instance...

How to Add the JVM Component to an Existing Oracle Database (Doc ID 1461562.1)

Applies to: Oracle Server - Enterprise Edition - Version and later Information in this...

1 Introduction to the Oracle Database

1 Introduction to the Oracle Database---------------------------------------------------------------...
  • yyzh535
  • yyzh535
  • 2011年02月24日 00:11
  • 1284

How to manage Oracle Database User profile

SQL> set linesize 200 SQL> col TEMPORARY_TABLESPACE for a25 SQL> col DEFAULT_TABLESPACE for a25   ...

Important Changes to Oracle Database Patch Sets Starting With [ID 1189783.1]

 Important Changes to Oracle Database Patch Sets Starting With [ID 1189783.1] Modified 13-S...

How to Configure DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris,

How to Configure DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris, ...

How to install Oracle Database Server software silently with customized listener configuration

Applies to: Oracle Universal Installer - Version: and later   [Release: 10.2 and later ] ...

1 Introduction to Oracle Database读书笔记

文章出处 Home / Database / Oracle Database Online Documentation 11g Release 2 (11.2) / Database Administ...


DBID stands for database identifier. Which is a unique identifier for each oracle database running.w...
  • t0nsha
  • t0nsha
  • 2012年06月06日 14:33
  • 1194

How to Export and Import Oracle Database Statistics Information

Some times  not convenient to the database for analyisis when the database have a large mount of dat...
您举报文章:Connecting to an Oracle Database