How to test connection to Oracle Database using Java

后端 未结 10 1684
迷失自我
迷失自我 2021-02-04 09:56

Is there a way to test my connection to oracle database using Java? Here\'s my code.

public class OracleConnection {

    public static void main(String[] args)          


        
10条回答
  •  清歌不尽
    2021-02-04 10:26

    You can have an array of the your database server ips and iterate over them. For every failed connection attempt, you can proceed to the next ip from the array and try again. In case of a successful connection, you break the loop there and use the current connection which was established.

提交回复
热议问题