This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- hi yves even i think that the installanywhere variables are not getting updated.
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
09:08 AM
hi i have a problem in minimal and typical install sets
hi,
i am basically preparing two install sets :
Typical
Minimal
In the typical i am giving a user input panel and asking the end user for mysql database parameters like:
server machine username password etc and i check for some specific tables if the tables exist i give a message like "the database contains the required tables for something". Similarily i give a user input panel for minimal install set and prompt the user for Database connection parameters but my problem is when i move in between the install sets,the same dialog appears.
That is say for typical install set i get a dialog saying " the database has the tables required"
But if i move back and give the wrong information or something goes wrong for minimal install set even then i get the same dialog box can someone suggest me where i am going wrong
i am using a custom code for checking the database connection and checking for the existance of tables. what shall i do to avoid this
i am basically preparing two install sets :
Typical
Minimal
In the typical i am giving a user input panel and asking the end user for mysql database parameters like:
server machine username password etc and i check for some specific tables if the tables exist i give a message like "the database contains the required tables for something". Similarily i give a user input panel for minimal install set and prompt the user for Database connection parameters but my problem is when i move in between the install sets,the same dialog appears.
That is say for typical install set i get a dialog saying " the database has the tables required"
But if i move back and give the wrong information or something goes wrong for minimal install set even then i get the same dialog box can someone suggest me where i am going wrong
i am using a custom code for checking the database connection and checking for the existance of tables. what shall i do to avoid this
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
09:45 AM
Can you post a sample project?
Probably you are setting a variable which does not get updated or your code only executes once...
Best Regards,
Yves
Probably you are setting a variable which does not get updated or your code only executes once...
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 09, 2008
01:24 AM
hi yves,
if i move between the install sets then also the proper message dialog does not appear and within the same install set if i change the fields also then also the proper dialog is not coming properly.
Regards,
James
if i move between the install sets then also the proper message dialog does not appear and within the same install set if i change the fields also then also the proper dialog is not coming properly.
Regards,
James
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 09, 2008
06:57 AM
package com.xxx.roinstaller;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import com.zerog.ia.api.pub.CustomCodeRule;
public class RODataBaseRuleAnother extends CustomCodeRule {
public final static String DRIVER =ruleProxy.substitute("$DRIVER$");
public final static String URL =ruleProxy.substitute("$URL$");
public final static String USER = ruleProxy.substitute("$USER$");
public final static String PASSWORD = ruleProxy.substitute("$PASSWORD$");
//public final static String PATH_TO_FILE =ruleProxy.substitute("$PATH_TO_FILE$");
//public final static String DEBUG_SQL = ruleProxy.substitute("$DEBUG_SQL$");
public final static String DB_TO_BE_USED=ruleProxy.substitute("$DB_TO_BE_USED$");
private Properties dbprops = new Properties();
private Driver myDriver = null;
private Connection connection = null;
private Statement statement1 = null;
@Override
public boolean evaluateRule() {
// TODO Auto-generated method stub
dbprops.put("user",USER);
dbprops.put("password", PASSWORD);
try {
System.out.println(URL);
System.out.println(DRIVER);
System.out.println(USER);
System.out.println(PASSWORD);
//System.out.println(PATH_TO_FILE);
//System.out.println(DEBUG_SQL);
System.out.println(DB_TO_BE_USED);
myDriver = (Driver)Class.forName(DRIVER).newInstance();
connection = DriverManager.getConnection(URL, dbprops);
statement1 = connection.createStatement();
ResultSet stored=statement1.executeQuery("SELECT * FROM yyy.xys_alert r;");
ResultSet storedano=statement1.executeQuery("SELECT * FROM zzzz.xys_dfphttp r;");
System.out.println("passing after the query");
System.out.println(URL);
System.out.println(DRIVER);
System.out.println(USER);
System.out.println(PASSWORD);
return true;
} catch ( ClassNotFoundException cnfe ) {
System.out.println("Unable to load database driver.");
//ruleProxy.getVariable("$USER_INPUT_RESULT_0$");
//ruleProxy.setVariable("$USER_INPUT_RESULT_0$",null);
return false;
} catch ( SQLException sqle ) {
System.out.println("Unable to connect to database.");
return false;
} catch ( IllegalAccessException iae ) {
System.out.println("Unable to access driver.");
return false;
} catch ( InstantiationException ie ) {
System.out.println("Unable to instantiate driver.");
return false;}
catch(Exception ee){return false;}
}
}
This is the rule which i am attaching to the panel for verifying if the database exits and contains the tables.
But it works fine for the first time if i move back and enter different data the same result is getting displayed,please show some way out of this issue
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import com.zerog.ia.api.pub.CustomCodeRule;
public class RODataBaseRuleAnother extends CustomCodeRule {
public final static String DRIVER =ruleProxy.substitute("$DRIVER$");
public final static String URL =ruleProxy.substitute("$URL$");
public final static String USER = ruleProxy.substitute("$USER$");
public final static String PASSWORD = ruleProxy.substitute("$PASSWORD$");
//public final static String PATH_TO_FILE =ruleProxy.substitute("$PATH_TO_FILE$");
//public final static String DEBUG_SQL = ruleProxy.substitute("$DEBUG_SQL$");
public final static String DB_TO_BE_USED=ruleProxy.substitute("$DB_TO_BE_USED$");
private Properties dbprops = new Properties();
private Driver myDriver = null;
private Connection connection = null;
private Statement statement1 = null;
@Override
public boolean evaluateRule() {
// TODO Auto-generated method stub
dbprops.put("user",USER);
dbprops.put("password", PASSWORD);
try {
System.out.println(URL);
System.out.println(DRIVER);
System.out.println(USER);
System.out.println(PASSWORD);
//System.out.println(PATH_TO_FILE);
//System.out.println(DEBUG_SQL);
System.out.println(DB_TO_BE_USED);
myDriver = (Driver)Class.forName(DRIVER).newInstance();
connection = DriverManager.getConnection(URL, dbprops);
statement1 = connection.createStatement();
ResultSet stored=statement1.executeQuery("SELECT * FROM yyy.xys_alert r;");
ResultSet storedano=statement1.executeQuery("SELECT * FROM zzzz.xys_dfphttp r;");
System.out.println("passing after the query");
System.out.println(URL);
System.out.println(DRIVER);
System.out.println(USER);
System.out.println(PASSWORD);
return true;
} catch ( ClassNotFoundException cnfe ) {
System.out.println("Unable to load database driver.");
//ruleProxy.getVariable("$USER_INPUT_RESULT_0$");
//ruleProxy.setVariable("$USER_INPUT_RESULT_0$",null);
return false;
} catch ( SQLException sqle ) {
System.out.println("Unable to connect to database.");
return false;
} catch ( IllegalAccessException iae ) {
System.out.println("Unable to access driver.");
return false;
} catch ( InstantiationException ie ) {
System.out.println("Unable to instantiate driver.");
return false;}
catch(Exception ee){return false;}
}
}
This is the rule which i am attaching to the panel for verifying if the database exits and contains the tables.
But it works fine for the first time if i move back and enter different data the same result is getting displayed,please show some way out of this issue
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 09, 2008
09:28 AM
THE install.exe is attached herein
What i am doing is i am giving a user input panel and i ask for
ipaddress of the server machine,
username,
password,
database to be used
,
and then i add an action :
set installanywhere multiple variables action and set these installanywhere variables:
$DB_TO_BE_USED$ EQUALS database to be used
$URL$
$USERNAME$
$PASSWORD$
and then i show the dialog box
probably here i am doing wrong as i am setting installanywhere variables which i am using in the custom code ,if i move back and proceed these installanywhere variables set by me are not getting refreshed.
please suggest me why and show some way out of it.
What i am doing is i am giving a user input panel and i ask for
ipaddress of the server machine,
username,
password,
database to be used
,
and then i add an action :
set installanywhere multiple variables action and set these installanywhere variables:
$DB_TO_BE_USED$ EQUALS database to be used
$URL$
$USERNAME$
$PASSWORD$
and then i show the dialog box
probably here i am doing wrong as i am setting installanywhere variables which i am using in the custom code ,if i move back and proceed these installanywhere variables set by me are not getting refreshed.
please suggest me why and show some way out of it.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 09, 2008
12:15 PM
You declare the variables as final. How should they be refreshed?
Best Regards,
Yves
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 10, 2008
12:43 AM
hi yves,
Ok now i will declare the variables as public static and one more thing
:
I am getting the user input variables and setting the values of $DB_TO_BE_USED$ ,$DRIVER$ after that to these $USER_INPUT_VARIABLES$".
Shall i use the $DB_TO_USED$,$DRIVER$ ETCdirectly in the user input panels.
instead of setting them.
Looking for a suggestion.
Ok now i will declare the variables as public static and one more thing
:
I am getting the user input variables and setting the values of $DB_TO_BE_USED$ ,$DRIVER$ after that to these $USER_INPUT_VARIABLES$".
Shall i use the $DB_TO_USED$,$DRIVER$ ETCdirectly in the user input panels.
instead of setting them.
Looking for a suggestion.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 10, 2008
10:43 AM
I would use them directly...
Best Regards,
Yves
Best Regards,
Yves