import java.io.*;
import java.sql.*;
public class sql{
public static void main(String args[]) throws ClassNotFoundException,SQLException
{
Class.forName("oracle.jdbc.OracleDriver") ;
System.out.println("Oracle JDBC driver loaded ok.");
Connection con = DriverManager.getConnection(
"jdbc:oracle:thin:cs359/cs359@192.168.1.198:1521:orcl");
System.out.println("Connected with @192.168.1.198:1521:orcl");
con.setAutoCommit(false);
Statement stmt = con.createStatement();
ResultSet rset =null;
rset = stmt.executeQuery("select * from emp");
while (rset.next())
System.out.println (rset.getString(1));
rset.close();
stmt.close();
System.out.println ("Ok.");
}
}
I KRISHNAPRASAD PURSUING MY B.TECH IN C.R.REDDY COLLEGE OF ENGINEERING TRADE COMPUTER SCIENCES AND ENGINEERING. I'M HAPPY TO PRESENT ALL TYPE OF PROGRAMS. I HOPE U UTILISE THIS BLOG AND ENJOY YOUR PROGRAMMING. THESE PROGRAMS ARE BEST COMPILED IN TURBO C++ COMPILERS AND SUN JAVA COMPILERS
Thursday, November 25, 2010
SQL-JAVA
Subscribe to:
Post Comments (Atom)

This comment has been removed by the author.
ReplyDeleteBetway Casino Site – All your favourite games from Microgaming
ReplyDeleteBetway casino luckyclub site, also called Betway, is a trusted online casino with a great range of games. This is why Betway is one of the best casinos in