Hi,
I want to connect the Oracle Database connection.Could you provide examples coding .If any jar files needed kindly provide that link.
Thanks
Printable View
Hi,
I want to connect the Oracle Database connection.Could you provide examples coding .If any jar files needed kindly provide that link.
Thanks
Google is your friend.
But Your my best Friend than Google
New bestseller: 'How to make sure not to get help' by balaji_csc ;)
To connect to an Oracle database, you need first to have the Oracle database itself installed started and accepting connections.
Then you need to get the oracle JDBC driver for your version (you probably will have it already as part of the installation). You then need to read Sun's JDBC tutorial to find out what classes you need to use and how to use those classes to make the connection.
Hi,
Thanks for informaiton.
While Ruuning the Java programming,java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver Excepetion.Need jar class12.jar files .Please provide the link
import java.sql.*;
public class OracleExample
{
public static void main(String args[]) throws ClassNotFoundException,SQLException
{
ResultSet rRs;
PreparedStatement rPs;
Class.forName("oracle.jdbc.driver.OracleDriver");
//conn = DriverManager.getConnection("jdbc:oracle:thin:@loc alhost:1521:katarina","scott" ,"tig er");
Connection con= DriverManager.getConnection("jdbc:oracle:thin:@loc alhost:3306:Oracle","rose","rose");
System.out.println("Connection EstablishMent.........."+con);
String Query="";
rPs=con.prepareStatement("");
rRs=rPs.executeQuery(Query);
while(rRs.next())
{
System.out.println("");
}
}
}
JDBC/UCP Download Page
P.S Make sure to close connections in a finally block after using them.
Not just connections, all resources (resultset, then statement, then connection, in that order).
Good practice and all that...:)