Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Tolls

Thread: Connection

  1. #1
    MEGHNA. is offline Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default Connection

    package com.dao;
    import java.sql.Connection;
    import java.sql.DriverManager;


    public class connectdao {

    public static Connection connect()
    {
    String server="";
    String portno="";
    String sid="";
    String pwd="";
    String user="";
    String url="jdbc:oracle:thin:@"+server+":"+portno+":"+sid ;
    Connection con=null;
    try
    {
    Class.forName("oracle.jdbc.driver.OracleDriver");

    con = DriverManager.getConnection(url,user,pwd);


    }catch(Exception e)
    {
    System.out.println(e.getMessage());
    }finally
    {
    return con;
    }
    }

    }

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

    Default Re: Connection

    And?
    There seem to be a lot of people posting random code today.
    quad64bit likes this.

Similar Threads

  1. tcp connection
    By tsunamy_boy in forum Java Applets
    Replies: 19
    Last Post: 08-06-2010, 08:42 PM
  2. Java.net.socket connection :connection closed
    By veeru541 in forum Advanced Java
    Replies: 2
    Last Post: 06-27-2010, 02:14 AM
  3. FTP connection
    By java2010 in forum New To Java
    Replies: 3
    Last Post: 04-19-2010, 09:46 AM
  4. Replies: 7
    Last Post: 10-20-2009, 10:34 AM
  5. no connection
    By even in forum JDBC
    Replies: 15
    Last Post: 01-02-2008, 01:50 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
  •