Oracle database to java application connectivity-Example - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Oracle database to java application connectivity-Example

Oracle database to java application connectivity-Example

                   "  Connection build Oracle database to Java                                                           Applictaion"


package com.shahsi;
import java.sql.*; 
class OrecleCon{ 
public static void main(String args[]){ 
try{ 
//step1 load the driver class 
Class.forName("oracle.jdbc.driver.OracleDriver"); 
System.out.println("Driver is loaded");
 
//step2 create  the connection object 
Connection con=DriverManager.getConnection( 
"jdbc:oracle:thin:@localhost:1521:xe"," SYSTEM"," oracle"); 
 
//step3 create the statement object 
Statement stmt=con.createStatement(); 
 
//step4 execute query 
ResultSet rs=stmt.executeQuery("select * from curd"); 
while(rs.next()) 
System.out.println(rs.getString(1)+"  "+rs.getString(2)+"  "+rs.getString(3)+" "+rs.getString(4)); 
 
//step5 close the connection object 

con.close(); 

}catch(Exception e){ System.out.println(e);} 
 
}  }



   How to create Table in oracle 10 G commond line : 
  

     here: describe youer  field

   insert into table name values:

SELECT * FROM TABLENAME ;
DISPLAY TABLE 

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.