URL string format for connecting to Oracle database with JDBC

前端 未结 7 1487
予麋鹿
予麋鹿 2020-12-02 09:44

I\'m a newbie to Java-related web development, and I can\'t seem to get a simple program with JDBC working. I\'m using off-the-shelf Oracle 10g XE and the Eclipse EE IDE. Fr

7条回答
  •  长情又很酷
    2020-12-02 10:46

    The correct format for url can be one of the following formats:

    jdbc:oracle:thin:@::;  (if you have sid)
    jdbc:oracle:thin:@//:/serviceName; (if you have oracle service name)
    

    And don't put any space there. Try to use 1521 as port number. sid (database name) must be the same as the one which is in environment variables (if you are using windows).

提交回复
热议问题