comp.lang.ada
 help / color / mirror / Atom feed
* ada calling into C library?
@ 1998-10-30  0:00 Danny
  1998-10-30  0:00 ` jim
  1998-10-31  0:00 ` Jerry van Dijk
  0 siblings, 2 replies; 3+ messages in thread
From: Danny @ 1998-10-30  0:00 UTC (permalink / raw)


I've a project on a unix system V platform using gnat compilers...

What I would like to do is have a C / C++ library communicating with a
database and ada programs making calls into that library to get data.
Ideally I would like the library to return objects ala COM but this may
be unrealistic so I would be happy enough to return structures /
records.  Does anyone know how possible this is and if is likely to be
worth the effort.  Its not an option to use C throughout the project but
Ada could be used to communicate with the database.  The reason for
using C is so I can use the Rogue Wave DBTools classes to deal with the
database.

-Danny





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ada calling into C library?
  1998-10-30  0:00 ada calling into C library? Danny
@ 1998-10-30  0:00 ` jim
  1998-10-31  0:00 ` Jerry van Dijk
  1 sibling, 0 replies; 3+ messages in thread
From: jim @ 1998-10-30  0:00 UTC (permalink / raw)


In article <3639E39E.EFA4B968@aston.ac.uk>, Danny says...
>
>I've a project on a unix system V platform using gnat compilers...
>
>What I would like to do is have a C / C++ library communicating with a
>database and ada programs making calls into that library to get data.
>Ideally I would like the library to return objects ala COM but this may
>be unrealistic so I would be happy enough to return structures /
>records.  Does anyone know how possible this is and if is likely to be
>worth the effort.  Its not an option to use C throughout the project but
>Ada could be used to communicate with the database.  The reason for
>using C is so I can use the Rogue Wave DBTools classes to deal with the
>database.
>
 

I found the easiest and fastest and best way to do this sort of thing is
to use Java. Plain and simple.

I can write any kind of database application using the Java SQL pacakge
and the any JDBC driver for the specicif database in question that will 
run on any platform, in 2-3 days most. why do people want to deal with
anything else, is beyond me.

The first time I did this, it was so easy I could not beleive it. it took
me 2 days to write a complete database import export of tables using nothing
but pure Java. 

why deal with C/C++ and figure how to call Ada from all of that, and COM
and that, keep it simple. trust me. look it up and you'll see for yourself.

Jim.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ada calling into C library?
  1998-10-30  0:00 ada calling into C library? Danny
  1998-10-30  0:00 ` jim
@ 1998-10-31  0:00 ` Jerry van Dijk
  1 sibling, 0 replies; 3+ messages in thread
From: Jerry van Dijk @ 1998-10-31  0:00 UTC (permalink / raw)


Danny (clarked@aston.ac.uk) wrote:

: I've a project on a unix system V platform using gnat compilers...

: What I would like to do is have a C / C++ library communicating with a
: database and ada programs making calls into that library to get data.

Yes, that can be done by writing an Ada binding to the C/C++ library.

: Ideally I would like the library to return objects ala COM but this may
: be unrealistic so I would be happy enough to return structures /
: records. 

That depents on the model. I do not know if there is COM support on
Sys V (I doubt it), but Corba should be doable.

: Does anyone know how possible this is and if is likely to be
: worth the effort.

Yes, its worth the effort, especially if you reuse the bindings for
other projects.

:    Its not an option to use C throughout the project but
: Ada could be used to communicate with the database.  The reason for
: using C is so I can use the Rogue Wave DBTools classes to deal with the
: database.

In that case (presuming there is no Ada binding to DBTools), why write
intermediate C or C++ code. Why not interface to the DBTools directly ?

Jerry.

-- 
-- Jerry van Dijk  | email: jdijk@acm.org
-- Leiden, Holland | member Team-Ada
-- Ada & Win32: http://stad.dsl.nl/~jvandyk




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-10-31  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-30  0:00 ada calling into C library? Danny
1998-10-30  0:00 ` jim
1998-10-31  0:00 ` Jerry van Dijk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox