Results 1 to 7 of 7
  1. #1
    katko0ota is offline Member
    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

    Wink whats the code that we need to connect oracle10g with the netbeans

    hi every one

    i need to connect oracle 10 with jave (netbeans 6)

    how can i??

    and whats the code i have to use connect them??

    please replay quickly:(:(

    i neeeeeeeeeeed it help me

  2. #2
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    I am not sure what you mean by connecting Oracle with Netbeans but if I get it right you might just want to search for a JDBC tutorial. There is one right on this site: http://www.java-forums.org/java-tuto...nectivity.html
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  3. #3
    katko0ota is offline Member
    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

    Default

    thanx danielstoner

    i mean how can i connect the oracle10g with netbeans6 that i need it in my

    project that its a website like e-voting that can we vote by internet >>the data base and interface i use oracle10g<<<

    and by sms >>> so that i use netbeans

    so i dont know how to connect them

    i hope thats clear to help me

  4. #4
    katko0ota is offline Member
    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

    Default

    i need the code that help me to connect the oracle10g with netbeans??

    and can you show me how to connect step by step

    thanx for reading my post

  5. #5
    roo7 is offline Member
    Join Date
    Nov 2007
    Posts
    6
    Rep Power
    0

    Default

    package yourPackage;

    import java.sql.*;


    public class connection {

    /** Creates a new instance of connection */
    public connection() {
    }

    public static Connection getConnection(){
    Connection connect =null;

    try{
    //load the driver
    Class.forName("oracle.jdbc.driver.OracleDriver");


    connect = DriverManager.getConnection("jdbc:oracle:thin:@loc alhost:1521:xe","system","manager");
    }
    catch(ClassNotFoundException cnfe){
    cnfe.printStackTrace();
    }
    catch(SQLException sqle){
    sqle.printStackTrace();
    }
    return connect;
    }

    }

  6. #6
    Eku
    Eku is offline Senior Member
    Join Date
    May 2008
    Location
    Makati, Philippines
    Posts
    234
    Rep Power
    7

    Default

    Same as roo7, i just detailed some parts ^_^

    Java Code:
    ResultSet Rs = null; 
    try {Class.forName("oracle.jdbc.OracleDriver");
                connection conn = "Oracle:thin:@<IP>:<port>:<SID>","<username>","<password>";
                Statement Stmt = conn.prepareStatement(query);
                 RS = Stmt.executeQuery();
                } catch (Exception ex) { ex.printStackTrace(); }
    Just make sure you have properly configured your oracle, database and also installed the oracle driver.,
    Mind only knows what lies near the heart, it alone sees the depth of the soul.

  7. #7
    linuxswan is offline Member
    Join Date
    Mar 2008
    Posts
    28
    Rep Power
    0

    Default

    You can find the Database connectivity in the menus where you can provide all the information like ODBC connectivity.

Similar Threads

  1. Cannot understand whats wrong
    By Lehane_9 in forum New To Java
    Replies: 1
    Last Post: 03-06-2008, 08:57 PM
  2. Code to connect to a web site
    By suji in forum Networking
    Replies: 1
    Last Post: 02-15-2008, 05:05 PM
  3. Replies: 9
    Last Post: 12-18-2007, 10:02 AM
  4. Whats wrong with my code???
    By Soda in forum New To Java
    Replies: 2
    Last Post: 12-06-2007, 01:54 PM
  5. whats the difference between Java core,J2EE......
    By prince24 in forum New To Java
    Replies: 2
    Last Post: 07-11-2007, 07:54 PM

Posting Permissions

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