Wednesday, April 20, 2005 10:19 AM
Hi, if you are using DSN less JDBC drivers to connect to the oracle database(presuming you have downloaded them from the oracle website), u need to put them into your jdk/jre/lib/ext directory. Then set the following environment variables:
PATH = your jdk/bin directory
JAVA_HOME = your jdk directory
Now compile your programs in the following way:
>javac -classpath . thejavafile.java
In the java file use the following statement for your connection with database:
where mydatabase is tha name of the database and scott and tiger are the username and passwords respectively.
Hope this helps!
Best of Luck!
Tuesday, April 19, 2005 05:02 PM
First include classes111.jar in your class path.
then you can use the following code in java file to connect to the database
String URLString = "jdbc:oracle:thin:@hoststring:port:databasename"
Connection con = DriverManager.getConnection(URLString,"DatabaseUserName","DatabasePassword");
here the letters in italics are the one that you enter specific to your environment. for example host string is www.xyz.com ...etc.