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 odbc. how is it related to sql cli?

609


How to use JDBC to connect Microsoft Access?

605


What is setautocommit in jdbc?

503


What are the considerations for deciding on transaction boundaries?

569


What are restrictions on triggers?

1686






What is the difference between executing, executequery, executeupdate in jdbc?

570


How to check jdbc driver version in sql server?

492


What class.forname will do while loading drivers of jdbc?

510


What is isolation level? How to set it?

1653


What is execute in java?

527


What is the feature of jdbc v4?

498


What is serialization and deserialization in java programming?

535


How to get the Database server details in java program?

585


What is JDBC PreparedStatement?

541


Why do we use jdbc in java?

554