工具 myeclips也可使用eclipse
關于代碼的一些補充
加載mysql的驅動 Class.forName(“com.mysql.jdbc.Driver”);
加載Oracle的驅動 Class.forName(“oracle.jdbc.driver.OracleDriver”);
連接數據庫 “jdbc:mysql://localhost:port/dbname”;
在這里解釋下localhost是指你數據庫的IP,如果你是本地數據庫那么就寫localhost或者127.0.0.1,port代表端口,一般為3306,具體看情況;dbname是指你數據庫的名字
另外確保驅動jar包已經構建路徑,如下圖

新聞熱點
疑難解答