Whether to use JNI-JDBC from C++ OR directly use C++ API for connecting to Sybase RDBMS

Hi,

I have a design problem to solve. Please suggest a better solution based on
your experience.

1)Whether it is advisable to directly connect to Sybase DB using some
approriate API from a C++ Application? Or
2)Is it better to go for JNI Wrapper on the JDBC calls to connect to Sybase
DB from C++ App.

Problem definition: We have a C++ core application which logs to a file the
packets which it grabs from an port/Interface at realtime and at the
sametime sends it to a Web based GUI application over a socket
connection.The logging in file is done, so that the same packet information
can be replayed in offline mode. Now we have the requirement is to replace
the log files with a standard RDBMS. And we have decided to go for Sybase
RDBMS. SO in this new scenario, the C++ core application will populate the
DB and at the same time send the information on a socket to GUI for
reporting purpose in raltime mode. In offline mode, the Java based GUI would
directly query the RDBMS to get the data already populated during the
realtime mode.

The design goal would be have good Performance, since we are dealing with
realtime data on an interface, we should be populating the RDBMS with every
packet that is being read on the interface without loosing any packet

As GUI is Java based it looks cleaner to have all Java based solution. For
queries from GUI obvious choice is to go for JDBC as Sybase RDBMS is very
well supported by JDBC driver and more over GUI side there is no much of a
performance issue.
But the issue is only in C++ core code which will populate the Database.So
my questions in the beginiing apply to only this issue.

Now with 1st approach I feel it would be a performance efficient solution,
but I do not know have much idea or have used any APIs for directly
connecting to Sybase from an C++ API. Does Sybase provide any APIs for this
solution? If so does it come along with Sybase RDBMS? Because we are looking
for some freeware preferably.

2nd approach: By using JNI as the glue between C++, which in turn will make
JDBC calls to populate the Sybase RDBMS, will it degrade the performance?
The advantage with this approach is that even if C++ code is ported to java
or for whatever reason RDBMS changes then there is nothing much to
change.Has anybody tried this approach. If so can you please give some hints
as to how to go about and some example code if possible.
If anyone has encountered similar problem, please let me know the pros and
cons of both approach.

Thanking you in advance,
Regards,
Sunita


0
sunita
10/24/2002 1:11:26 PM
sybase.ase.general 8655 articles. 0 followers. Follow

1 Replies
1502 Views

Similar Articles

[PageSpeed] 4
Get it on Google Play
Get it on Apple App Store

sudesai@cisco.com wrote...
> Hi,
> 
> I have a design problem to solve. Please suggest a better solution based on
> your experience.
> 
> 1)Whether it is advisable to directly connect to Sybase DB using some
> approriate API from a C++ Application? Or
> 2)Is it better to go for JNI Wrapper on the JDBC calls to connect to Sybase
> DB from C++ App.
> 
> Problem definition: We have a C++ core application which logs to a file the
> packets which it grabs from an port/Interface at realtime and at the
> sametime sends it to a Web based GUI application over a socket
> connection.The logging in file is done, so that the same packet information
> can be replayed in offline mode. Now we have the requirement is to replace
> the log files with a standard RDBMS. And we have decided to go for Sybase
> RDBMS. SO in this new scenario, the C++ core application will populate the
> DB and at the same time send the information on a socket to GUI for
> reporting purpose in raltime mode. In offline mode, the Java based GUI would
> directly query the RDBMS to get the data already populated during the
> realtime mode.
> 
> The design goal would be have good Performance, since we are dealing with
> realtime data on an interface, we should be populating the RDBMS with every
> packet that is being read on the interface without loosing any packet
> 
> As GUI is Java based it looks cleaner to have all Java based solution. For
> queries from GUI obvious choice is to go for JDBC as Sybase RDBMS is very
> well supported by JDBC driver and more over GUI side there is no much of a
> performance issue.
> But the issue is only in C++ core code which will populate the Database.So
> my questions in the beginiing apply to only this issue.
> 
> Now with 1st approach I feel it would be a performance efficient solution,
> but I do not know have much idea or have used any APIs for directly
> connecting to Sybase from an C++ API. Does Sybase provide any APIs for this
> solution? If so does it come along with Sybase RDBMS? Because we are looking
> for some freeware preferably.
> 
> 2nd approach: By using JNI as the glue between C++, which in turn will make
> JDBC calls to populate the Sybase RDBMS, will it degrade the performance?
> The advantage with this approach is that even if C++ code is ported to java
> or for whatever reason RDBMS changes then there is nothing much to
> change.Has anybody tried this approach. If so can you please give some hints
> as to how to go about and some example code if possible.
> If anyone has encountered similar problem, please let me know the pros and
> cons of both approach.

You can certainly connect to ASE through an API from C++.  I don't use C++ so I can't 
comment any further on that.  When Open Client is installed on a machine you can choose to 
install sample code.  On my Win2K machine the location is C:\sybase\OCS-12_0\sample\ctlib.

IMO, performing the insert directly from the C++ application is the ideal situation.  It 
should be the fastest method and present fewer problems due to fewer layers.
-- 
Jim Egan [TeamSybase]

0
Jim
11/1/2002 10:28:14 PM
Reply:

Similar Artilces:

Upgrading C/C++ interface using dblib to use ctlib.
Can anyone direct me to good doc, perhaps sample code, etc., dealing with ctlib? I have a C/C++ interface written to dblib that must be upgraded to go against ctlib. Thank you. On Tue, 11 Nov 2003 08:56:30 -0800, wrote: > Can anyone direct me to good doc, perhaps sample code, etc., dealing with > ctlib? I have a C/C++ interface written to dblib that must be upgraded to > go against ctlib. Thank you. There's sample code in .../OCS/samples/ctlibrary. There's also a migration guide (of sorts) in the OCS docs: http://sybooks.sybase.com/onlinebooks/group-cn/c...

How Can I use the compliers used under Dev-C++ in C++ builder?
How Can I use the compliers (for instance GCC, ...) used under Dev-C++ in C++ builder? In my program,I used boost lambda expression under Dev-C++ due to the fact that C++ builder 2009 do not support such expression. But Dev-C++ do not support RAD(rapid application development). It is hard to establish the common graphic GUI under windows.So I want to use the compliers of Dev-C++ in C++ builder. And I do not know how to manage it. Where can I get the related materials or advices? Can any one with kindness help me? Il Tue, 11 Aug 2009 23:29:59 -0700, lserjt lserjt <> ha scritto:...

C Components Using Watcom C/C++ Compiler
This is a cryptographically signed message in MIME format. --------------ms2646818B6AC700D6597C3859 Content-Type: multipart/mixed; boundary="------------E0BFC7D7A6CA166C48EDA143" This is a multi-part message in MIME format. --------------E0BFC7D7A6CA166C48EDA143 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Does anyone have an example of C skeleton files and Watcom C/C++ make file to compile and load C components into Jaguar using the Watcom C/C++ compiler/Linker? --------------E0BFC7D7A6CA166C48EDA143 Content-Type: text/x-vcard; ch...

C<use autodie> unravels C<use strict>
------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Content-Description: a letter from tchrist Content-ID: <10727.1298817978.1@chthon> Everything I touch today crumbles in my hands. When you use autodie, you implicitly declare legal any scalar variable whose name matches that of any function it "fatalizes". Here's a (partial) dump of %main:: during the compilation and run of the enclosed program: BEFORE AUTODIE => $0 @ARGV %ENV @INC %INC @_ &dump_main &func1 &funcU AFTER AUTODIE...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

superreview granted: [Bug 232503] Start using Empty[C]String() : [Attachment 140140] Use Empty[C]String()
Peter Van der Beken <peterv@propagandism.org> has granted Johnny Stenback <jst@mozilla.jstenback.com>'s request for superreview: Bug 232503: Start using Empty[C]String() http://bugzilla.mozilla.org/show_bug.cgi?id=232503 Attachment 140140: Use Empty[C]String() http://bugzilla.mozilla.org/attachment.cgi?id=140140&action=edit ------- Additional Comments from Peter Van der Beken <peterv@propagandism.org> > Index: editor/libeditor/html/Makefile.in > =================================================================== > @@ -58,19 +58,18 @@ CPPSRCS =...

superreview requested: [Bug 232503] Start using Empty[C]String() : [Attachment 140140] Use Empty[C]String()
Johnny Stenback <jst@mozilla.jstenback.com> has asked Peter Van der Beken <peterv@propagandism.org> for superreview: Bug 232503: Start using Empty[C]String() http://bugzilla.mozilla.org/show_bug.cgi?id=232503 Attachment 140140: Use Empty[C]String() http://bugzilla.mozilla.org/attachment.cgi?id=140140&action=edit ...

How to run UNIX commands using C language ( C Language not C# langauge)
I am running Windows XP Professional and I want to run some UNIX commands from C langauge. Commands like semget and someother commands. Is there any tool that I can use with windows XP to run C language and use UNIX commands instead of installing the UNIX operating system. Thanks, HighOnCodingWanna get high! I think installing Linux is the way to go but have you looked at  http://www.cygwin.com?Cygwin is a Linux environment that run on Windows.  Check it out.    It's all over and I'm standin' prettyIn this dust that was a cityIf I could find a souvenier...

Using Project and C/C++ API - getting First Chance exception ...
Hi, I'm creating a UL application using the C/C++ API. I created a project in Sybase Central and typed in the following SQL statement. select UPrice, ItemDesc from Inventory where SKU = ? SKU, UPrice and ItemDesc are varchar types (different lengths for each). I run ulgen and get the .cpp, .hpp and .h files using the string below. 'ulgen -c "dsn=BDC" -t c++ -j Inventory -u InventoryPubAPI -f InventoryAPI' All looks good until I try to open the Record set. ----- int nlength = cs_ItemSKU.GetLength(); if ( GetDPSQL.Open( &ULConn_conn, cs_ItemSK...

Is it possible to use ASP.NET (C#) to do make direct TCP connection?
Hi, Is it possible to use ASP.NET (C#) to do a direct TCP connection to an application??? It will be an aspx website running in IIS. Thanks in advance!! well, i never tried this in my asp.net applications. i think if u build some connections within your page , it means there will be hundreds/thousands/even millions of connections in your server when you publish your application( building the connection in the Application-Scope is another story, while i cannot see why we need that). Personally, based on my understanding, i think you can. why don't you build one project and...

how to use XPath , XQuery,XSLT using C#.
how to use  XPath , XQuery,XSLT  using C#. please provide with example. Thanks  XPath you use to get a XmlNodeList or XmlNode from XmlNode/XmlDocument: XmlNodeList = xmlDocument.DocumentElement.SelectNodes("descendant-or-self::someNode[@someAtribute='something']"); XSLT you use in XslCompiledTransform to convert a XML in another like xslCompiledTransform.Load(xsltString); xslCompiledTransform.Transform(xmlReader, xmlWriter). Hi coolzubair , <root>  <itemsA>    <item id="1">this is result</item&...

how to use inheritance with asp.net using c#
Hi,  Can someone teach me how to use inheritance with asp.net, using c#? I tried to search for this but the examples I found would not work. I want to create a master page of .cs file which contains a class, and this class will have common variable and methods(functions). Thanks for the help in advance. Cheers. Here's a good article on how to create a base class: http://aspnet.4guysfromrolla.com/articles/041305-1.aspxThanks, EdMicrosoft MVP - ASP/ASP.NET check those pages http://www.codeproject.com/KB/cs/csharpintro01.aspx http://www.exforsys.com/tutorials/csharp/inher...

how to use generics using c#,asp.net
how to use generics using c#, asp.net Hi, first read this article to get a grasp of generics: An introduction to C# generics. After that you can experiment with generics. The most used way is to make use of the List<T> to use such a generic list for binding it to a DataSource property of a data presentation control (listview, repeater, ...). Also you can use this in combination with an ObjectDataSource control. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons. Hi,reddi U can refer These Links ...

Using c/c++ libraries in ASP.net
 Hello, I want to know if there is any way to use c/c++ libraries (.h) when creating a web page in ASP.net. Thanks for your help....

How to get the source for a page using C/C++?
How to get the source for a webpage page using C/C++? Scenario: I'm in a JavaScript callback (for example the callHook callback) and I have a JSContext * and a JSScript at my disposal. How can I get the page source code for this page? One answer is get the filename from the script. That is great if its a local filename such as c:\myWebPage.html as I can open that using fopen() etc. However if its a non-local file such as http://someWebAddress/page.html or one of the chrome:// pages then I can't open that. I don't want to fetch the page myself as the page conten...

Web resources about - Whether to use JNI-JDBC from C++ OR directly use C++ API for connecting to Sybase RDBMS - sybase.ase.general

Connecting rod - Wikipedia, the free encyclopedia
In a reciprocating piston engine , the connecting rod or conrod connects the piston to the crank or crankshaft . Together with the crank, they ...

COVER BOY: Dec. 15 Issue of ‘Time’ Features Mark Zuckerberg on Connecting the World
The cover of the Dec. 15 issue of Time features a familiar face — that of Facebook co-founder and CEO Mark Zuckerberg , the star of a long feature ...

Digital Media Wire - connecting people & knowledge —
dmwnews : Anomaly, the ambitious graphic novel by Brittenham and Haberlin, features augmented reality. http://bit.ly/Iwrxjr Already optioned ...

Connecting People to Brands and Products on Mobile
People come to Facebook not only to connect with friends and family but also with products and brands. Here's how we're making it easier to list ...

What stops users from connecting with an app through Facebook?
... This equals 850 million users who connect with apps using Facebook at a 59 percent conversion rate. About 590 million users back out of connecting ...

Home - WHLT 22 Connecting the Pine Belt Fan
Facebook is a social utility that connects people with friends and others who work, study and live around them. People use Facebook to keep up ...

US IT Staffing Recruiters Group - Connecting Ideas !
US IT Recruiter's Groups: IT Technical Recruitment. Its all about connecting to new Ideas !

Cold Christmas Bubbles - A Cool Connecting Dots Puzzle for Kids on the App Store on iTunes
Get Cold Christmas Bubbles - A Cool Connecting Dots Puzzle for Kids on the App Store. See screenshots and ratings, and read customer reviews. ...

Connecting a Relay to Arduino - Flickr - Photo Sharing!
Simple circuit to connect a 5V relay to one of the digital output pins of the Arduino. I drew this after a few threads showed up on the Arduino ...

Evidence Connecting Scott Roeder to Operation Rescue Found in Roder's Car - YouTube
Rachel Maddow unveils video evidence from KMBC TV in Kansas City of a note found in Scott Roeder's car at the time of his arrest for the murder ...

Resources last updated: 12/8/2015 7:18:26 PM