connectivity with oracle

hi to all!

i am writing a code below for connectivity to oracle with java.but there are some errors.

import java.sql.*;

public class TestDBOracle {

public static void main(String[] args)

throws ClassNotFoundException, SQLException

{

Class.forName("oracle.jdbc.Driver.OracleDriver");

//

// or

// DriverManager.registerDriver

// (new oracle.jdbc.driver.OracleDriver());

String url = "jdbc:oracle:thin:@//server.local:1521/prod";

// jdbc:oracle:thin:@//host:port/service

// or

// String url = "jdbc:oracle:thin:@server.local:1521:prodsid";

// jdbc:oracle:thin:@host:port:SID

Connection conn =

DriverManager.getConnection(url,"scott", "tiger");

conn.setAutoCommit(false);

Statement stmt = conn.createStatement();

ResultSet rset =

stmt.executeQuery("select * from vishal");

while (rset.next()) {

System.out.println (rset.getString(1));

}

stmt.close();

System.out.println ("Ok.");

}

}

kindly help me out!!!!!

[1089 byte] By [vishal_nitja] at [2007-11-26 19:51:05]
# 1
> there are some errorsWould you like to elaborate on that, or do you just expect us to guess what the errors might be?
dcmintera at 2007-7-9 22:40:53 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
> i am writing a code below for connectivity to oracle> with java.but there are some errors.And you need to tell us what they are.However I do note that the url you are using doesn't look valid to me.
jschella at 2007-7-9 22:40:53 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...