| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | initializing the database |
PE> How do I actually initialize the database from my C program, ie before my
PE> SQL starts.
Depends on the system you're using.
PE> With DB2, it considers itself to be so important that it will run
PE> your program for you. Well that's great unless you have another
PE> environment that thinks it's even more important again (Windows?
PE> CICS?) that wants to run the program instead. Well I think the
PE> database should be just another tool, not the overseer of all
PE> things. With DB2 you can use Call Attach Facility, rather than let
PE> DB2 to pretend to be too important, but I can't remember what it was
PE> about.
You don't run programs in the DB2 address space. Under TSO (batch or
online) you normally run it under the DB2 command processor, which
initialises the connection to DB2 and then runs you program.
Under CICS the connection task is started when the CICS region comes up.
CICS then runs the programs as it normally would.
If you don't, or can't, use the DB2 command processor, then you can use the
Call Attach Facility. If you do this then you must explicitly connect and
disconnect from DB2 yourself.
PE> Anyway, the real problem is that to initialize the Squish
"database", I
PE> need to somehow pass across the name of my squish.cfg. Sure, I can make
PE> dbInit() take a char * as a parameter, but that's not going to help me if
PE> another database needs 2 files to operate, etc. BFN.
There's a big difference DB2 and Squish. When you connect to DB2 you're
basically say "hello, here I am" and that's it. DB2 will handle
opening and closing any datasets that it needs.
With Squish, you'll need to open each message area individually. You could
try opening them all at the same time, but you'll probably hit problems
with the number of file handles.
If you want to make Squish operate more like DB2 then you'll need to write
a front end connection program. You could pass this program the name of
your program and you Squish configuration file. Something like:
sqconn c:\squish\squish.cfg tobruk.exe -a3:711/934 ...
This would then do what ever is required to initialise Squish and start
your program. Your program would then make calls to an interface routine
(which could just be part of SQCONN) instead of calling msgapi directly.
The interface would handle opening and closing the message areas. If you
make it a bit more intelligent, it could even keep the 10 most recently
used area open.
Paul
--- GoldED/2 2.42.G1114
* Origin: It's life Jim, but not as we know it (3:711/934.1)SEEN-BY: 635/514 640/305 711/809 934 @PATH: 711/934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.