how to know the url

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rahana
    New Member
    • Oct 2007
    • 12

    #1

    how to know the url

    my java programme is unable to connect to the database as there may be error in my port no,username,pas sword or url.how can i know the correct url
    which i have to use so that my programme works fine.
    the code which i have used is


    import java.sql.*;

    public class Stmt
    {
    public static void main(String args[])throws Exception
    {

    try{
    Class.forName(" oracle.jdbc.dri ver.OracleDrive r");
    Connection con=DriverManag er.getConnectio n("jdbc:oracle: thin:@localhost :1521:xe","scot t","tiger");
    Statement stmt=con.create Statement();
    String vsql="create table testtable(cone number,ctwo number)";
    stmt.executeUpd ate(vsql);
    System.out.prin tln("...Success ....");
    con.close();
    }
    catch(ClassNotF oundException e)
    {
    System.out.prin tln(e);
    System.out.prin tln("hello");
    }

    }
    }
    Thanking you
    Rahana
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Please don't open two or more threads for your single problem. I have closed this
    thread for now and I'll delete it soon.

    kind regards,

    Jos

    Comment

    Working...