Java how to check if mysql is running

joseph prosper

I just find this code and I use to check if MYSQL Server is running after every ten second...by call this method

public static boolean hostAvailabilityCheck(String address, int port) {
try (Socket s = new Socket(address, port)) {
        return true;
    } catch (IOException ex) {
        /* ignore */
    }
    return false;
}

so do I do it right, or there is other better way for check for MYSQL if still running after some second? please help me.

Peter Majko

The port can be open without any application listening to it. If you want to see also that your mySQL application is listening on the port, get mySQL connector for JAVA and look how to establish a connection - with user name and password.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to check if docker daemon is running?

分類Dev

How to check if GLFW window is running?

分類Dev

How to check the process is already running or not

分類Dev

Keeping the loop running to check for multiple conditions - Java

分類Dev

How to check 'mdadm' RAIDs while running?

分類Dev

How to check performance of mysql query?

分類Dev

How to check duplicate value in MySQL

分類Dev

How to terminate a running loop in java?

分類Dev

How to check how long a process has been running?

分類Dev

How to check the test coverage in java?

分類Dev

How to check if SSIS package called by T-SQL running finished

分類Dev

How to check if my program is running on MinGW(or MSYS) shell, or on CMD?

分類Dev

How do you check which version of Meteor you are running?

分類Dev

How do I check whether my shell is running in a terminal?

分類Dev

How to check event scheduler status mysql

分類Dev

How to check if a user requires SSL in Mysql?

分類Dev

Check if a process is running on Bosun

分類Dev

Check if an Interval is running and viceversa

分類Dev

Check if process is running and kill it

分類Dev

Check URL and running function?

分類Dev

How to check if value is present in list in java

分類Dev

How to check if an object exists in a LinkedList in java?

分類Dev

How do I check a key press in Java?

分類Dev

How to read JSON data from a web server running PHP and MySQL?

分類Dev

how to compare binary in mysql with JAVA

分類Dev

PHP / Mysql / Highscore table - How to check existing scores and replace them

分類Dev

How to check whether shell scripts / Vim running in VS Code integrated terminal?

分類Dev

How can check running dev_appserver.py with datastore-emulator

分類Dev

Running a series of scripts in MySQL

Related 関連記事

  1. 1

    How to check if docker daemon is running?

  2. 2

    How to check if GLFW window is running?

  3. 3

    How to check the process is already running or not

  4. 4

    Keeping the loop running to check for multiple conditions - Java

  5. 5

    How to check 'mdadm' RAIDs while running?

  6. 6

    How to check performance of mysql query?

  7. 7

    How to check duplicate value in MySQL

  8. 8

    How to terminate a running loop in java?

  9. 9

    How to check how long a process has been running?

  10. 10

    How to check the test coverage in java?

  11. 11

    How to check if SSIS package called by T-SQL running finished

  12. 12

    How to check if my program is running on MinGW(or MSYS) shell, or on CMD?

  13. 13

    How do you check which version of Meteor you are running?

  14. 14

    How do I check whether my shell is running in a terminal?

  15. 15

    How to check event scheduler status mysql

  16. 16

    How to check if a user requires SSL in Mysql?

  17. 17

    Check if a process is running on Bosun

  18. 18

    Check if an Interval is running and viceversa

  19. 19

    Check if process is running and kill it

  20. 20

    Check URL and running function?

  21. 21

    How to check if value is present in list in java

  22. 22

    How to check if an object exists in a LinkedList in java?

  23. 23

    How do I check a key press in Java?

  24. 24

    How to read JSON data from a web server running PHP and MySQL?

  25. 25

    how to compare binary in mysql with JAVA

  26. 26

    PHP / Mysql / Highscore table - How to check existing scores and replace them

  27. 27

    How to check whether shell scripts / Vim running in VS Code integrated terminal?

  28. 28

    How can check running dev_appserver.py with datastore-emulator

  29. 29

    Running a series of scripts in MySQL

ホットタグ

アーカイブ