Roadmap

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

Roadmap

#1

Postby HarryDeBoer » Tue Jul 12, 2016 11:35 am

In your roadmap is stated:

Next major version will be V5.2. Release date July 2016, details to come.

Can you give a hint what major and minors we can expect?
0 x
Kind regards,

Harry

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Tue Jul 12, 2016 12:19 pm

The big thing is the ability to publish REST services. V5.1 added the ability to act as client for a REST service, so this completes the support for REST.

Other minor items include:
  • - Quick way to issue SQL statements without using a Database Resource
    - Quick way to load property files
It also includes numerous changes to support running Ebase in a cloud environment. More on this subject will be published later.
0 x

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

#3

Postby HarryDeBoer » Thu Jul 14, 2016 6:43 am

Hi Jon,

>>Quick way to issue SQL statements without using a Database Resource

How does this work, and what are scenario's to use it?

when will 5.2 be out approx?
0 x
Kind regards,

Harry

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Thu Jul 14, 2016 8:29 am

1. Quick way to issue SQL statements without using a Database Resource or field mappings: see below
2. Scenarios - you can continue to use Database Resources with field mappings, this new technique just gives you an alternative.
3. V5.2 release is targeted for the end of July

New SQL statement helper functions are available via services.database. There are a number of functions available covering all SQL statements. Here's a preview of the doc for the executeSelectStatement function:

executeSelectStatement(databaseConnectionName, selectStatement, callbackFunction)
* Executes a SQL select statement and passes each returned row to the specified callback function. The callback function should be
* specified with a single argument representing an object containing a key/value pair for each column in the row, see examples.
*
* The function should return true to continue execution or false to terminate execution. If the return is omitted, execution continues.
*
* Example 1: load Ebase table
*
* services.database.executeSelectStatement(
* "SAMPLES",
* "select cat_name, cat_value, creation_date from categories",
* function (columnData)
* {
* tables.categories.insertRow();
* tables.categories.categoryName.value = columnData.cat_name;
* tables.categories.categoryValue.value = columnData.cat_value;
* tables.categories.creationDate.value = columnData.creation_date;
* return true; // continue
* });
*
* Example 2: load Ebase table - the table contains columns with the same names as the columns returned by the SQL statement.
* Note that this technique cannot be used with columns of type Date, Time or DateTime.
*
* var rowData = [];
* var tableData = {rows: rowData};
* services.database.executeSelectStatement("SAMPLES", "select * from tablexyz",
* function (columnData)
* {
* rowData.push(columnData);
* return true;
* });
* // load the table
* tables.sampleTable.loadFromJSON(JSON.stringify(tableData));
* // scroll to display the first row
* tables.sampleTable.control.scrollToTop();
*
* @param databaseConnectionName the name of the Database Connection as configured in the Server Administration Application
* @param selectStatement the SQL statement to execute
* @param callbackFunction callback function called with each row of data returned from the database
* @throws SQLException
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#5

Postby Segi » Thu Jul 14, 2016 8:45 pm

No offense but how is this any better/more efficient than the other way of executing a database statement without a database resource in JavaScript like this ?

Code: Select all


var sql="SELECT * FROM MyTable";

var con=system.getDatabaseConnection("MYDATABASECONNECTION");
var rs,stmt;

try {
     stmt=con.prepareStatement(sql);
     rs=stmt.executeQuery();

     while (rs.next()) {
     }
} catch (e) {
     // Dump the SQL for debugging purposes
     print("An error occurred reading the database with the query " + sql);
     print(e);

     if(rs) rs.close();
     if(stmt) stmt.close();
     if(con) con.close();

     event.stopExecution();
} finally {
     if(rs) rs.close();
     if(stmt) stmt.close();
     if(con) con.close(); 
} 
There aren't any date/time restrictions when doing it this way and it is easier to manage because there's no need for a callback function so you can see exactly what the code does without jumping around and with less code.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#6

Postby Jon » Fri Jul 15, 2016 8:10 am

It isn't better or more efficient, it's just a little less code. Plus I think it's much more accessible for non-Java people.
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#7

Postby Steve James » Mon Aug 01, 2016 2:22 pm

Any news? Publishing REST! Excellent.

I know I am chasing the gun but it's no longer the end of July :D

Thanks
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#8

Postby Jon » Mon Aug 01, 2016 2:39 pm

Yes sorry about that. The development is all completed but we still need to do the documentation and we've run into summer holidays. I think it will be another month.
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#9

Postby Steve James » Mon Aug 01, 2016 2:45 pm

Arghhh :o ,

I was really hoping for publishing RESTful services asap as I am trying to get momentum around OpenData. Internally I want to use Ebase to dynamically create csv files and publish the same data over an API.
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#10

Postby Steve James » Fri Aug 05, 2016 2:45 pm

Hi, out of interest how do you protect from sql injection if a select statement is built from field values?

Obviously the following wouldn't be safe.

Code: Select all

var selectStmt = "select * from tablexyz where value = '" + fields.value.value + "'"; 
services.database.executeSelectStatement("SAMPLES", selectStmt, 
* function (columnData)....... 
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#11

Postby Jon » Mon Aug 08, 2016 8:06 am

There isn't any protection against SQL Injection when using this technique. If you think SQL Injection is possible in any particular circumstance, it will be safer to use a Database Resource.
0 x


Who is online

Users browsing this forum: No registered users and 26 guests