Home > database >  11.2 g oracle accounted exist memory leak (using valgrind detection)
11.2 g oracle accounted exist memory leak (using valgrind detection)

Time:10-05

Use accounted to access oracle
The Environment * env.
The Connection * conn.
The Statement * STMT;
The ResultSet * rs.
String username="system";//user name
String password="st1234";//password
String connstring="former";//database connection string
String SQL, strname;
Int isno;
Env=the Environment: : createEnvironment ();//create the environment variable//
Conn=env - & gt; The createConnection (username, password, connstring);//create a database connection object of the leak
STMT=conn - & gt; CreateStatement ();//a Statement object the third leaked
SQL="SELECT u_id, u_name, to_char (u_date, 'yyyy - mm - dd hh24: mi: ss') FROM student";
STMT - & gt; SetSQL (SQL);//to the SQL statement
Try
{
Rs=STMT - & gt; ExecuteQuery ();//executing SQL statements, result set
While (rs - & gt; Next ())//get data
{
Isno=rs - & gt; Get int (1);
Strname=rs - & gt; Get string (2);
Cout<& lt; Isno & lt; & lt; "AND" & lt; & lt; Strname & lt; & lt; endl;
Cout<& lt; Rs - & gt; Get string (3) & lt; & lt; endl;
}
cout <& lt;" The SELECT SUCCESS "& lt; & lt; endl;
}
The catch (SQLException ex)//exception handling
{
cout <& lt; "The Error Number" & lt; & lt; Ex. GetErrorCode () & lt; & lt; endl;
cout <& lt; Ex. GetMessage () & lt; & lt; endl;
}
Conn - & gt; TerminateStatement (STMT);//terminate the Statement object
Env - & gt; TerminateConnection (conn);//disconnect from the database
Environment: : terminateEnvironment (env);//terminate the environment variable
return 1;

CodePudding user response:

Change the version a try, even if sweep out what the underlying reveal that you are not processing, and customer communication or later add some validation best remedy

CodePudding user response:

Looking for ORACLE technical support?
Or to send the problem to see ITPUB

CodePudding user response:

Don't understand this, don't know whether I like this kind of high-level language c # has destroyed object syntax;

CodePudding user response:

Player, but this thing is not the same as the standard, as defined in the open a sr to ask, who know how oracle can give a reply,

Is worth learning, continuous attention

CodePudding user response:

Are you sure is a memory leak (100 times call 100 long memory, call 10000 long 10000 times), and not like the buffer function of the connection pool?
  • Related