I need some help with the eclipse.
I have a project which need to connect to oracle databases so i have the ojdbc jar file and a simple project.
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@"+this.host+":"+this.port+":"+this.db,this.user,this.pass);
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(query);
while (rset.next())
{
retStr += rset.getString(1) + ',';
}
stmt.close();
conn.close();
}
and I got an exception that the oracle.jdbc.driver.OracleDriver
is not exists.
how do I add the jar to my project and use it?
I did this step and I still get the exception. You will have to add the jar to your Classpath. You can do that in eclipse by right clicking on the Project --> Build Path --> Configure Build Path