Results 1 to 9 of 9

Thread: Access registry

  1. #1
    kkk
    kkk is offline Member
    Join Date
    Jul 2009
    Posts
    11
    Rep Power
    0

    Default Access registry

    I want to check whether MySql server is installed in a system. For that I have to access registry. Is there any way to access registry through Java code.

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    5

    Default

    Simply try to open a database connection with a mysql driver should prove whether mysql is installed.

    Edit: with invalid credentials and check for "Access denied for user" in the Exception message.
    Last edited by mrmatt1111; 09-01-2009 at 08:01 AM.
    My Hobby Project: LegacyClone

  3. #3
    kkk
    kkk is offline Member
    Join Date
    Jul 2009
    Posts
    11
    Rep Power
    0

    Default

    But I want to check during installation of a software.

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    What if the program was uninstalled but the registry key for it was not removed?
    Last edited by r035198x; 09-01-2009 at 09:09 AM.

  5. #5
    kkk
    kkk is offline Member
    Join Date
    Jul 2009
    Posts
    11
    Rep Power
    0

    Default

    I tell in detail.
    I want to create a installer. That installer has to check whether MySql is installed in that particular system or not? So only I want to check the registry through java.
    How can i achieve this seniors?

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Use another language that is more suitable to the task. Java is platform independence meaning it should not be used for platform dependent tasks.
    P.S You also did not answer my question above.

  7. #7
    kkk
    kkk is offline Member
    Join Date
    Jul 2009
    Posts
    11
    Rep Power
    0

    Default

    Can you suggest any language to do that task?
    I did not know answer for your question, do u suggest any idea for that?
    I hope it save me...

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    C/C++ are capable languages. If you still want your installer to be a Java one then you can call the C/C++ functions using JNI.
    The question was just to make you aware of the limitations of your approach. Your installer would also be useless on Non-Windows machines.

    P.S There are also a few programs that generate installers for you. Google will help point them out.

  9. #9
    kkk
    kkk is offline Member
    Join Date
    Jul 2009
    Posts
    11
    Rep Power
    0

Similar Threads

  1. RMI registry
    By tarunkumar in forum Advanced Java
    Replies: 1
    Last Post: 09-30-2008, 08:02 PM
  2. Registry Problem
    By Mir in forum New To Java
    Replies: 1
    Last Post: 07-19-2008, 04:12 PM
  3. SWT Font Registry Example
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-07-2008, 04:46 PM
  4. windows registry
    By Fleur in forum New To Java
    Replies: 3
    Last Post: 06-20-2008, 03:23 AM
  5. could not be found in the registry
    By alam99 in forum Eclipse
    Replies: 0
    Last Post: 01-08-2008, 08:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •