JDBC THIN Oracle with Java6

Posted by Sopolin on Stack Overflow See other posts from Stack Overflow or by Sopolin
Published on 2009-09-04T03:13:05Z Indexed on 2010/05/09 20:28 UTC
Read the original article Hit count: 223

Filed under:
|
|

Hi all,

I have a problem with JDBC Thin in Oracle 11g with NetBeans V6.7.1. I don't know how to configure it. I have already set classpath of ojdbc6.jar and orai18n.jar. But I still can't run this example in NetBeans:

import java.sql.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.OracleDataSource;
class JDBCVersion
{
    public static void main (String args[]) throws SQLException
    {
        OracleDataSource ods = new OracleDataSource();
        ods.setURL("jdbc:oracle:thin:easycash/oracle@oracle:1521/validus");
        Connection conn = ods.getConnection();
        // Create Oracle DatabaseMetaData object
        DatabaseMetaData meta = conn.getMetaData();
        // gets driver info:
        System.out.println("JDBC driver version is " + meta.getDriverVersion());
    }
}

Could anyone help finish my work?

Thanks, Sopolin

© Stack Overflow or respective owner

Related posts about netbeans

Related posts about java