dbTalk Databases Forums  

Memory exception with connection to Oracle

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Memory exception with connection to Oracle in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
vinod.katare@gmail.com
 
Posts: n/a

Default Memory exception with connection to Oracle - 11-14-2007 , 12:52 AM






Hi,

When i am trying to execute the below code, getting the memory
exception " Unable to read memory". Can anybody suggest me of what can
be the problem?
Also the exception is only if a add a createconnection statement. For
connection to oracle from iSQLPLus i am using the same usr/pass
without hoststring and its working there.

Thanks,
Vinod K

#include "occi.h"
#include<stdio.h>
#include<string.h>
#include<conio.h>
using namespace oracle:cci;
main()
{
Environment *env ;
Connection *conn=env->createConnection("scott", "tiger","");
printf("Done");
getch();
}


Reply With Quote
  #2  
Old   
frank.van.bortel@gmail.com
 
Posts: n/a

Default Re: Memory exception with connection to Oracle - 11-14-2007 , 08:20 AM






On 14 nov, 07:52, vinod.kat... (AT) gmail (DOT) com wrote:
Quote:
Hi,

When i am trying to execute the below code, getting the memory
exception " Unable to read memory". Can anybody suggest me of what can
be the problem?
Also the exception is only if a add a createconnection statement. For
connection to oracle from iSQLPLus i am using the same usr/pass
without hoststring and its working there.

I'm not familiar with how occi connects, but iSQLPlus runs against
a defined environment.

I suggest occi uses an tns alias to connect, so look into
your tnsnames.ora file (locted in %ORACLE_HOME\network\admin)
for one. An example of an entry is:

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = your-hostname.is.here)(PORT =
1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.yourdb_domain.here)
)
)

in this example, the first "Orcl" would be the alias.
If it reads "orcl.whatever.com", use that.

hth, frank



Reply With Quote
  #3  
Old   
DA Morgan
 
Posts: n/a

Default Re: Memory exception with connection to Oracle - 11-16-2007 , 06:49 PM



vinod.katare (AT) gmail (DOT) com wrote:
Quote:
Hi,

When i am trying to execute the below code, getting the memory
exception " Unable to read memory". Can anybody suggest me of what can
be the problem?
Also the exception is only if a add a createconnection statement. For
connection to oracle from iSQLPLus i am using the same usr/pass
without hoststring and its working there.

Thanks,
Vinod K

#include "occi.h"
#include<stdio.h
#include<string.h
#include<conio.h
using namespace oracle:cci;
main()
{
Environment *env ;
Connection *conn=env->createConnection("scott", "tiger","");
printf("Done");
getch();
}
Go to http://otn.oracle.com
Click on Forums
Create a userid for yourself
There are forums for OCI and OCCI.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #4  
Old   
Kevin English
 
Posts: n/a

Default Re: Memory exception with connection to Oracle - 11-17-2007 , 12:07 PM



On Wed, 14 Nov 2007 06:52:04 -0000, vinod.katare (AT) gmail (DOT) com wrote:

Quote:
Hi,

When i am trying to execute the below code, getting the memory
exception " Unable to read memory". Can anybody suggest me of what can
be the problem?
Also the exception is only if a add a createconnection statement. For
connection to oracle from iSQLPLus i am using the same usr/pass
without hoststring and its working there.

Thanks,
Vinod K

#include "occi.h"
#include<stdio.h
#include<string.h
#include<conio.h
using namespace oracle:cci;
main()
{
Environment *env ;
Connection *conn=env->createConnection("scott", "tiger","");
printf("Done");
getch();
}
Your env is uninitialized so of course env->createConnection() will be
trying access garbage.
--
Kevin English

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.