how to resolve Got minus one from a read call in oracle 11g jdbc 7/14 jdk 1.7?

前端 未结 4 1513
旧巷少年郎
旧巷少年郎 2021-01-20 08:44

I am using netbeans and jdk 7 updt 9 with 1.7 and following is my code.

public class jd {
    public static void main(String[] args) throws ClassNotFoundExcep         


        
4条回答
  •  [愿得一人]
    2021-01-20 09:13

    DriverManager throws this error when it tries to get a connection with invalid URL. Make sure your URL is valid. Things to checkout:

    1. Port: Oracle db runs on 1521. (note: don't confuse yourself with webport of oracle, which can be any other port as in your URL 1158).
    2. DB name: Get the db name from Oracle Web UI: (home->adminIstration->aboutdatabase->settings)
    3. URL format: "jdbc:oracle:thin:@localhost:1521:YourDbName"

提交回复
热议问题