Results 1 to 2 of 2

Thread: Connectivity in java with oracle

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Answers
    1

    Connectivity in java with oracle

    how we connect database using oracle 9i with java ?


  2. #2
    Junior Member
    Join Date
    Sep 2007
    Answers
    1

    Re: Connectivity in java with oracle

    THIS IS THE JDBC PROGRAME

    import java.sql.*;
    import javax.sql.*;
    import java.io.*;


    public class CSDemo
    {
    public static void main(String ar[])
    {
    try
    {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    }

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

    try
    {
    Connection
    c=DriverManager.getConnection("jdbcrcle:thin:@localhost:1521:gdn","scott","tiger");
    CallableStatement cs=c.prepareCall(" { call pr_nk1 } " );
    cs.registerOutParameter(1,Types.VARCHAR);
    cs.execute();
    String stvalue=null;
    stvalue=cs.getString(1);
    System.out.println(stvalue);
    cs.close();
    c.close();
    }
    catch(SQLExceptin e)
    {
    System.out.println(e);
    }
    }
    }


    BYE,
    NIRMAL KUMAR


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact