Hi ,

I want to test the database connectivity for sql server and oracle which user gives DB info (username and password) and i want to validate the connection. Is any built-in action provided by installbuilder for database connectivity? I'm new to install builder. Help me.

Thanks, Thananjeyan

asked 15 Mar '13, 02:49

Thananjeyan's gravatar image

accept rate: 0%

InstallBuilder does not provide built-in actions for connecting to databases.

What you can do is run an external program to check the connectivity. For example:

<validationActionList> <runProgram> <program>osql</program> <programArguments>-U "${username}" -P "${password}" -S "${instance}" -i "EXIT(SELECT 0)"</programArguments> <workingDirectory>${installdir}/osql</workingDirectory> </runProgram> <throwError> <text>Unable to connect to database</text> <ruleList> <compareValues> <logic>does_not_equal</logic> <value1>${program_exit_code}</value1> <value2>0</value2> </compareValues> </ruleList> </throwError> </validationActionList>

This will validate if specified username, password and instance is correct.

If you need to perform the check before installation, it is possible to unpack an entire directory for the test - for example:

<validationActionList> <deleteFile> <path>${system_temp_directory}/osql_test</path> </deleteFile> <unpackDirectory> <component>osql</component> <destination>${system_temp_directory}/osql_test</destination> <folder>osql</folder> <origin>osql</origin> </unpackDirectory> <runProgram> <program>osql</program> <programArguments>-U "${username}" -P "${password}" -S "${instance}" -i "EXIT(SELECT 0)"</programArguments> <workingDirectory>${system_temp_directory}/osql_test</workingDirectory> </runProgram> <deleteFile> <path>${system_temp_directory}/osql_test</path> </deleteFile> <throwError> <text>Unable to connect to database</text> <ruleList> <compareValues> <logic>does_not_equal</logic> <value1>${program_exit_code}</value1> <value2>0</value2> </compareValues> </ruleList> </throwError> </validationActionList>

It is documented in more details in Unpacking Before Installation Time section of InstallBuilder User Guide.


answered 15 Mar '13, 09:53

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 15 Mar '13, 02:49

Seen: 1,177 times

Last updated: 15 Mar '13, 09:53