krishi Bhas

Greenhorn
+ Follow
since Dec 18, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by krishi Bhas

I know these errors are occuring at compile time..i know how to use try-catch-finally . the problem is..how do i connect to the database..
If i want to connect to oracle 9i or 10g using type1 driver(Microsoft ODBC connection) creating dsn name and trying to connect to the database, the driverclass is not loading and its giving
Exception in thread "main" java.lang.NoClassDefFoundError: Jdbc/java

Here is the program:
import java.sql.*;
public class Jdbc{
public static void main(String args[]) throws Exception{
Connection conn=null;
try{
String driverclass="sun.jdbc.odbc.JdbcOdbcDriver";
String url="jdbc:odbc:custdsn";
String username="system";
String password="admin";
Class.forName(driverclass);
conn=DriverManager.getConnection(url,username,password);
System.out.println("connection established");
}
catch(Exception e){e.printStackTrace();}
finally{
conn.close();}
}
}
Jdbc.java:9: unreported exception java.lang.ClassNotFoundException; must be caug
ht or declared to be thrown
Class.forName(driverclass);
^
Jdbc.java:10: unreported exception java.sql.SQLException; must be caught or decl
ared to be thrown
Connection conn=DriverManager.getConnection(url,username,password);
^
Jdbc.java:12: unreported exception java.sql.SQLException; must be caught or decl
ared to be thrown
conn.close();
^
3 errors
No, how do i set the classpath for oracle12.zip
I am trying to connect to Oracle9i using Type-1 driver(JDBC-ODBC bridge). i have created dsn and when i am trying to run the program i am getting ClassNotFound exception
I am trying to connect to Oracle9i using Type-1 driver(JDBC-ODBC bridge). i have created dsn and when i am trying to run the program i am getting ClassNotFound exception.
I have paseed SCJP1.4 with 92%. Special thanks to Khalid Mughal book and to all the java gurus. SCJP faq helped me a lot
17 years ago
Hi guys,

Can any of you briefly explain me abt hashcode() and equals() methods.

Thanks
Krishi
Hi ,

i am taking the exam this month and i need suggestions from you guys. I have read Khalid mughals SCJP1.4 material and have done whizlabs exams and i am getting only 70% in the exams and i am bit worried about the final.