How to avoid parsing data fetched from database to dynamically create forms? - delphi

My application deserializes XML that is stored in a CLOB column in Oracle database to dynamically create forms. This approach allows relatively easy update deployment, but is too slow when a user connects through a VPN using e.g. 3G network.
I wonder is there a way to store those objects (forms) on the users's file system so that no parsing is needed?
I don't have any code to show but I hope this question is scoped narrowly enough to be acceptable.

My suggestion:
Make sure your form(s) is saved to the database in binary form, not as a text representation.
In your client app, request the CLOB column data from the DB and save it to a TMemoryStream. Then, you can instantiate the form by loading it from the TMemoryStream and it doesn't need to go near the file system on the client side. That way, no parsing of the Form data from the db is necessary.
The accepted answer to this q shows how to read a form from a memory stream - see the call to MemStream.ReadComponent et seq. Obviously, using tje method in that q, the CLOB data should have been created using the memorystream steps of its SaveComponentToFile.

Related

Generate a table in the UI Designer from a local variable and from business variable

I have a connector that selects data from an external database in Bonitasoft, I was able to assign the result of this select to a process variable and display the contents of that variable in the UI Designer in an Input type field, however I need to display this in a table, as I configure This in the UI Designer to display the contents of my process variable in a table, if possible show the step by step thank you. Another thing as I can also pass the contents of my connector to a business variable and then display in UI Designer also if needed
First of all I want to draw your attention that using business or process variables to store data already stored in an external database will lead to duplication.
Recommended solution would be to use a REST API extension (such as REST API SQL data source) to query the data from the external database and use this REST API extension in the forms.
Now if you are ok with duplication of data you can refer to an example I create that demonstrate how to set process and business data with PostgreSQL connector output and then display the variables in form table widgets.
I highly recommend to use business variable and if possible consider migrating the data from the external database to the business data database.

Handling more than one db server/different schema in the same server in a single application

As part of one of the requirements in our project we need to connect to a DB based on input in the UI and then fetch the result accordingly. Now this db can be on different db server or in the same db server it can be a different schema.
We are looking to do it in the most efficient way.
One of the ways we have figured out is having the db connection information (like db server, schema etc) in separate properties files. Based on the input from the UI, we pass the input to a db factory that will read the corresponding properties file and will return the corresponding db connection if it already exists, if it doesn't then it will create a new connection and will return it.
We are using spring; we use weblogic for application deployment.
The most efficient way would be to let the respective functions "know" where to look for the requested data. But that's a lot of work in advance.
If the schemes describe similar data (e.g. address data), think about merging the data or the implementation of an frontend/proxy. Both ways would delegate the "looking for data" to the DB-Server(s) which should be able to handle each request way faster and more efficient than any program-logic.

Binding a irregular URL encoded POST request with Nancy

I'm supposed to make an old sqlite database editable trough a Sketchup Plugin in its WebDialog. Sketchups Ruby is not able to install the sqlite3 gem and since I already need to display the table in a WebDialog, I opted for a micro service with the help of Nancy. The existing Plugin already uses the dhtmlxSuite and its Grid Component is exactly what I need. They even offer a Connector that can send requests based on the actions of the user in the grid.
They also offer a connector for the server side, but that too does not work with sqlite. I already managed to connect to my database, used Dapper to bin the result of an SQL query to an object and return that data with a manually crafted JSON object. Very hacky, but it populates the data successful.
Now the client-Connector sends data manipulated by the user (delete and insert is forbidden) back with an url encoded POST request that looks quite weird:
4_gr_id=4&4_c0=0701.041&4_c1=Diagonale%20f%3Fr%202.07%20X%201.50%20m&4_c2=AR&4_c3=8.3&4_c4=380&4_c5=38.53&4_c6=0&4_c7=0&4_!nativeeditor_status=updated&ids=4
I'm not sure exactly why the hell they would use the row index inside the key for the key-value pairs, but this just makes my life that much harder. The only thing that comes to my mind is extracting the data I'm interested in with a regex, but that sounds even worse than what I did before.
Any suggestions for me how I could map that POST request to something usable?

How to update the data table on client side.(iOS MMO game)

Currently I'm developing an iOS MMO game using cocos2d-x. The game uses many data tables (excel files) which are created by the designer. These tables contains such numbers as how much gold(crystal, etc..) will be needed for upgrading a barrack.
My question is, is that how to update that tables once if the tables have been modified on the server side?
My option: Use SQLite to store table on client side, once the tables has been modified on server side, the server will parse the tables (excel files) and send the data in JSON format.
then the client parse the JSON string and save that data to SQLite file.
Is there any better way? I find that some game stores CSV files on client side, how do they update those CSV files?
How you store the data (and in which format) is entirely up to you, although the framework does provide some helper classes (checkout ccUserDefault). The simplest way to check whethere data files on the client side are up to date is to checksum them (either apply a checksum to the data stored in the file or on the whole file itself). So to check for sync, the server side app applies a checksum to the data and so does the client (using the same algorithm, of course ;) ) and the numbers are compared; if they match, the data is in sync.
This is arguably more reliable if the server-side app generates the data files and sends them down, rather than relying on the client-side app to do it. But as long as the server knows how to generate data files using the same method that the client does, then the success of the client's file generation process can always be verified using this same checksum method.

How to Insert data from login form into database table

I am new to blackberry, i am doing application in eclipse,i got an situation, how to insert values into the database when entering the data in the login form which contain 2 fields username and password in blackberry applications, please provide solution.
It's quite difficult to understand what are you asking here.
Do you want to add login form data to a local (mobile) database? Or you want to add it to a centralized (to all applications) server?
In the former case, you need to use BlackBerry APIs to create and populate databases using Persistent Object Store (which is always available for BlackBerry Apps) or use any other database you can separately install in BlackBerry. Also consider using SQLite (integrated with BlackBerry OS 5 or superior).
In the latter case, you need to send login data through HTTP (or any other TCP based protocol) and once data is on you application server, you can insert it on any database it supports: MySQL, PostgreSQL, Oracle, SQLServer, Sybase, you name it.
http://docs.blackberry.com/en/developers/deliverables/8673/JDE_5.0_SQLiteGuide.pdf
DataStorage concept comes here.For this first of all learn how data can be inserted to a database table..The above link is a guide which helps you to learn everything about how table can be created,stored retrieved.
Store the data you entered in a variable viz.username,password using persistent storage..
Use these variable names in the Insertion syntax..

Resources