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
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
Comment