Date Created: Tue 22-Jan-2008

Related Document Categories:


    Validated Oracle sample jdbc connection test

    "jdbc:oracle:thin:@hostname:1522:TEST","steve","steve"

    host:port:database:username:password

    really this means we have database test, schema steve with password steve


    JDBCVersion.javacmdsetup.bat

    import java.sql.*;
    import oracle.jdbc.driver.*;
    class JDBCVersion
    {
    public static void main (String args[])
    throws SQLException
    {
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Get a connection to a database
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@hostname:1522:TEST","steve","steve");
    // Create Oracle DatabaseMetaData object
    DatabaseMetaData meta = conn.getMetaData();
    // gets driver info:
    System.out.println("JDBC driver version is " + meta.getDriverVersion());
    }
    }

Middleware Mentor - Steven Charles Robinson

About Me

Steve Robinson has been working in IT for over 15 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware consulting. Steve comes from both an administration and development background.

Before moving to JEE, Steve was an accomplished developer and consultant for both IBM Lotus Notes and Microsoft .NET Technologies.

Follow Steve as @stevencrobinson on twitter.

Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Oracle WebLogic Categories

JBoss Categories

Other Categories