1

for my project, i need the text box to get their values from database instead of files and static data in data pool. simply, my application is reading stored data from database then doing some actions then save new data to database.

mnel
  • 113,303
  • 27
  • 265
  • 254

2 Answers2

1

How about implementing an Iterator that can iterate over the database .Using this iterator we can get records from the database and feed it to the RFT script. Then you can again use some implemenation that goes back to the database to store the updated values. There is no api in RFT to do that as far as i know but RFT script being plain java/vb script you can do anything that is possible with java/vb.

Prakash
  • 742
  • 7
  • 19
0

Use JDBC to connect to the database you want and go from there.

String url = "jdbc:msql://athens.imaginary.com:4333/db_web";

    try {
      Class.forName("imaginary.sql.iMsqlDriver");
    }
    catch( Exception e ) {
      System.out.println("Failed to load mSQL driver.");
      return;
    }
    try {
      Connection con = DriverManager.getConnection(url, "borg", "");
      Statement select = con.createStatement();
      ResultSet result = select.executeQuery
                          ("SELECT key, val FROM t_test");         

      System.out.println("Got results:");
      while(result.next()) { // process results one row at a time
        int key = result.getInt(1);
        String val = result.getString(2);

        System.out.println("key = " + key);
        System.out.println("val = " + val);
      }
      select.close();
      con.close();
    }
    catch( Exception e ) {
      e.printStackTrace();
    }
JEuvin
  • 866
  • 1
  • 12
  • 31