how can connection with oracle10g with java

Answer Posted / rajshri

try
{
Class.forName("oracle.jdbc.driver.OracleDriver");

Connection con=DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:XE", "system", "system");
//(system,system is username and passward of oracle 10g)

Statement st=con.createStatement();

String sql="(here your sql statement must be of select
pattern)";

ResultSet rs=st.executeQuery(sql);

while(rs.next())
{
AND SO ON...

Is This Answer Correct ?    33 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is metadata in jdbc?

657


How to test jdbc connection to sql server?

692


What is jdbc driver for sql server?

700


In which ways is driver class is registered with drive manager?

712


List the common jdbc exceptions ?

773


What is the purpose of jdbc?

767


What is jdbc and its advantages?

702


What is the function of drivermanager class?

795


Which is better odbc or jdbc?

661


How you restrict a user to cut and paste from the html page using java programing?

643


What is ODBC and JDBC? How do you connect the Database?

736


How to know howmuch data is truncated?

2095


What are the types of jdbc drivers that exist?

711


What is jdbc thin client?

710


What are the utilities of the callablestatement?

720