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

How can we maintain the integrity of a database by using jdbc?

538


What is the function of setautocommit?

654


What is jdbc odbc driver?

580


Explain about DSN?

541


How to insert and delete a row programmatically? (new feature in JDBC 2.0)

536






What are devices?

496


What do you mean by jdbc batch processing and what are the advantages of using jdbc batch processing?

515


Why do we need a jdbcrowset like wrapper around resultset?

778


What are the methods which can verify the cursor particular position?

558


Are all the required JDBC drivers to establish connectivity to my database part of the JDK?

534


What does setautocommit do?

563


What is jdbc odbc in java?

533


How do I stop nullpointerexception?

516


What is jdbc driver for sql server?

542


How can I manage special characters when I execute an insert query?

524