Results 1 to 10 of 10
  1. #1
    balaji csc is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default Database Conneciton

    Hi,
    I want to connect the Oracle Database connection.Could you provide examples coding .If any jar files needed kindly provide that link.


    Thanks

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Google is your friend.

  3. #3
    balaji csc is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default Reg: Thanks

    But Your my best Friend than Google

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    New bestseller: 'How to make sure not to get help' by balaji_csc ;)
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    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.

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Quote Originally Posted by PhHein View Post
    New bestseller: 'How to make sure not to get help' by balaji_csc ;)
    Trying to break my friendship with balaji_csc?
    Jealous old man.

    balaji_csc had a fight with Google the other day so they are no longer close friends.:p

  7. #7
    balaji csc is offline Member
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Default Needed Jar files

    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("");

    }

    }

    }

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    JDBC/UCP Download Page


    P.S Make sure to close connections in a finally block after using them.

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,953
    Rep Power
    19

    Default

    Not just connections, all resources (resultset, then statement, then connection, in that order).
    Good practice and all that...:)

  10. #10
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Quote Originally Posted by r035198x View Post
    Trying to break my friendship with balaji_csc?
    Jealous old man.
    No, no, go on you two.
    Quote Originally Posted by r035198x View Post
    balaji_csc had a fight with Google the other day so they are no longer close friends.:p
    That's bad. :cool:
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. Database Help
    By simtology in forum New To Java
    Replies: 3
    Last Post: 08-18-2009, 03:03 PM
  2. Database Help
    By simtology in forum New To Java
    Replies: 1
    Last Post: 08-17-2009, 06:14 PM
  3. database
    By kswiss in forum AWT / Swing
    Replies: 0
    Last Post: 03-26-2009, 11:51 AM
  4. help with database
    By fahien_akim in forum NetBeans
    Replies: 0
    Last Post: 03-07-2009, 01:44 PM
  5. Replies: 2
    Last Post: 02-11-2009, 04:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •