
Here is my code:
import java.sql.*;
public class Tyagi
{
public static void main (String args[])throws SQLException
{
ResultSet rs;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:8080:oracle", "System", "System");
Statement st = conn.createStatement();
rs=st.executeQuery("Select * from brendon");
while(rs.next())
System.out.println(rs.getString(1));
st.close();
conn.close();
}
catch(Exception e)
{
System.out.println(e);
}
}
}
i have found exception in the code that is java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.