Hi again,
I have a DB2 database placed on a different database server (Remote) and I have C application placed on different location/pc.
I need to connect to the DB2 database from my C application.
Currently I use the ff. codes to connect to the database locally.
Code:
int ConnectToDB( struct dbConfig db )
{
if( !strlen( db.username ) || !strlen( db.password ) ) {
EXEC SQL CONNECT TO :dbName ;
}
else
{
strcpy( userId, db.username ) ;
strcpy( password, db.password );
EXEC SQL CONNECT TO :dbName user:userId using :password ;
}
SQLError( "CONNECT", SQLCODE, &sqlca ) ;
return( SQLCODE ) ;
}
Could somebody tell me how to do a remote connection using Embeded SQL in C and to the database w/c is on a different server.
any help would be much appreciated
Regards,
jaro
**all the sample codes that I've found in the net are all for connection locally. I can't seem to find a "connect" in this format connect(<host>, <username>, <password>);