第一种写法:String url = "jdbc:oracle:thin:@//11.1.0.151:1521/mega";
第二种写法:String second_url = "jdbc:oracle:thin:@11.1.0.151:1521:mega";
第一种写法造成报错:java.sql.SQLRecoverableException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor 连接数据库失败。
第二种写法:连接数据库成功。