Tuesday, January 7, 2014

SQuirrel JDBC version error while connecting to database

Getting the following error:

JRE/ JDBC Version mismatch 
The driver being used for alias 'DBSERVER' is not JDBC 2.1 compliance.


Steps
a) Right click on alias and select Alias Properties
b) Click on driver properties tab and then on 'Use driver properties'
c) In the 'HOSTNAME' click on checkbox in specify column and enter the desktop name in 'Value' column.
d) In the 'APPLICATIONNAME' click on check box 'Specify' column and enter 'squirrel' in 'Value' column.
e) Click 'OK' to accept the changes.

This resolved the error for me.

Please let me know your comments in case you observe this error.

Saturday, December 28, 2013

Multiple Sybase IQ DB Servers data with extract keys from file (Sybase C++ application)

The challenge ...

High performance C++ application interacting with multiple Sybase IQ servers.
Steps
a) Read some keys K from a file on disk.
b) For K keys, extract the data from DB Server S1 giving result R1.
c) Using the result R1, find the data from second DB Server S2 giving result R2.
d) Do some processing from C++ code on R2 data extracted in c) above.

Time taken in first run (POC) - 2 hours
Time taken in final implementation - 4 mins

Problems identified 
1) Reading the keys from file to C++ application and query the data R1 using these keys:

First query (run in batch):
select * from DBSERVERS1.SCHEMA.TABLE where key in (k1,k2,k3 ..., k1024) -- considering 1024 batch size.

Improved query:
i) Use Load Table to get the keys K1
ii) Join the Load Table with Server S1 data (NO need of "IN" clause).


2) Join of different server data
First query (
select * from DBSERVERS2.SCHEMA.TABLE where key in (k1,k2, k3,k4... ,k1024) -- considering 1024 batch size.
Where keys are obtained after join of K from file with table in DBSERVER S1.

Improved query steps
a) Create a temporary table in IQ DB S2 with result set R1 with the data extracted from using "INSERT INTO" LOCATE Syntax.
b) Perform a join operation of R1 (output of first query) with DB Server S2.

This should fetch the data a lot faster as compared to other methods (in clause or temporary table insert with "select union").

3) Aggregation at multiple levels - considering we wanted to aggregate per date, per month and per year.

First method
a) First query for daily data
b) Second query for aggregated monthly data
c) Third query for aggregated yearly data.

Improved method - using analytic function
Use the aggregation function of IQ (sum/ max) and use the GROUP BY ROLL UP (details)

Sunday, October 7, 2012

Executing pcd_write Windows issue with VC Express 08

For the newbies of PCL you might face the issues while debugging your PCL applications. 
> cmake working fine
> All compilation & linking completed successfully.

On executing the debug binary Error pops up - no solution or code change seems to be right?


Error message: 
The application failed to initialize properly (0xc0150002). Click OK to terminate the application.
Cause: 
This can occur because of the following reason:
>> Installed only VS Express version - the debug is not supported

Solution:
Try to compile and execute the release version - this is fully supported.

Other ways to ensure the problem is due to VS express edition
- <drive:>/Program Files\PCL 1.5.1\bin\ - try to execute any debug binary - it should also not initialize.
On executing: pcd_viewer_debug.exe : it throws an error:
>> This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

Error message in VC++ Debug mode: 
LDR: LdrpWalkImportDescriptor() failed to probe D:\Program Files\PCL 1.5.1\bin\pcl_common_debug.dll for its manifest, ntstatus 0xc0150002
Debugger:: An unhandled non-continuable exception was thrown during process load
The program '[18448] pcd_write_test.exe: Native' has exited with code -1072365566 (0xc0150002).