I connected with the macbook running on a virtual machine myeclipse8.6 oracle11g
public class BaseDao {
public final static String CLASSNAME = "oracle.jdbc.driver.OracleDriver";
public final static String URL = "jdbc: oracle: thin: @ 172.16.123.128:1521: orcl"; / / 172.16.123.128 this is a virtual machine ip
public final static String USERNAME = "xrj";
public final static String PASSWORD = "123456";
same code in a virtual machine is win7 myeclipse above the normal running , and then run myeclipse mac systems on the wrong , the error message is
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader $ 1.run (URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass (URLClassLoader.java: 190)
at java.lang.ClassLoader.loadClass (ClassLoader.java: 306)
at sun.misc.Launcher $ AppClassLoader.loadClass (Launcher.java: 301)
at java.lang.ClassLoader.loadClass (ClassLoader.java: 247)
at java.lang.Class.forName0 (Native Method)
at java.lang.Class.forName (Class.java: 171)
at chongwu.BaseDao.getConnection (BaseDao.java: 22)
at chongwu.ConsoleView.loginMenu (ConsoleView.java: 28)
at chongwu.ConsoleView.main (ConsoleView.java: 114)
Exception in thread "main" java.lang.NullPointerException
at chongwu.ConsoleView.loginMenu (ConsoleView.java: 29)
at chongwu.ConsoleView.main (ConsoleView.java: 114)
I am novice, English is not very good , seeking heroes who helped me in the end is where the problem is , after I switched to mac system the oracle jdbc class12.jar also been re-set , or have a special mac version of jdbc? or where I set up wrong ? , or use other ways to connect ? knees and begged , and thanked him
------ Solution --------------------------------------------
certainly jar package useless references right.
------ For reference only -------------------------------------- -
mac 's really more of the pit , we're in the new shoes have encountered various problems , Bangniding next .
没有评论:
发表评论