[Java]
Connection connection = null;
Statement st = null;
ResultSet rs = null;
try {
String driverName = "oracle.jdbc.driver.OracleDriver";
Class.forName(driverName);
String serverName = "127.0.0.1";
String portNumber = "8080";
String sid = "XE";
String url = "jdbcracle:thin" + serverName + ":" + portNumber + ":" + sid;
String username = "System";
String password = "test";
connection = DriverManager.getConnection(url, username, password);
String sql = "Select * from orders";
st = connection.createStatement();
rs = st.executeQuery(sql);
System.out.println(rs.toString());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e)
{
e.printStackTrace();
}
[/Java]
Fehlermeldung:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at user_interface.UI_Angebot.<init>(UI_Angebot.java:96)
at user_interface.mainframe.<init>(mainframe.java:19)
at main.running_main.main(running_main.java:24)
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at user_interface.UI_Angebot.<init>(UI_Angebot.java:96)
at user_interface.mainframe.<init>(mainframe.java:19)
at user_interface.mainframe.createAndShowGUI(mainframe.java:47)
at main.running_main$1.run(running_main.java:44)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Was mache ich falsch bzw. wo liegt der Fehler?
Connection connection = null;
Statement st = null;
ResultSet rs = null;
try {
String driverName = "oracle.jdbc.driver.OracleDriver";
Class.forName(driverName);
String serverName = "127.0.0.1";
String portNumber = "8080";
String sid = "XE";
String url = "jdbcracle:thin" + serverName + ":" + portNumber + ":" + sid;
String username = "System";
String password = "test";
connection = DriverManager.getConnection(url, username, password);
String sql = "Select * from orders";
st = connection.createStatement();
rs = st.executeQuery(sql);
System.out.println(rs.toString());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e)
{
e.printStackTrace();
}
[/Java]
Fehlermeldung:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at user_interface.UI_Angebot.<init>(UI_Angebot.java:96)
at user_interface.mainframe.<init>(mainframe.java:19)
at main.running_main.main(running_main.java:24)
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at user_interface.UI_Angebot.<init>(UI_Angebot.java:96)
at user_interface.mainframe.<init>(mainframe.java:19)
at user_interface.mainframe.createAndShowGUI(mainframe.java:47)
at main.running_main$1.run(running_main.java:44)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Was mache ich falsch bzw. wo liegt der Fehler?