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 does the connection object represents?

557


What port does jdbc use?

491


There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?

612


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

548


What is the use of the statement in jdbc?

489






What are JDBC Best Practices?

549


Which interface handles transaction management in jdbc?

564


How can you use preparedstatement in jdbc?

514


What is jdbc in java?

487


What is the role of jdbc drivermanager class?

563


What are the functions of the jdbc connection interface?

500


Is jdbc a middleware?

500


Is jdbc a protocol?

497


What is the use of dialect?

564


What is jdbc connection string?

503