oracle11g

Oracle data source connection pooling not working used with Spring and JDBCTemplate

五迷三道 提交于 2019-12-04 15:56:51
Question: Lot of active unclosed physical connections with database even with connection pooling. Can someone tell me why is it so? I configured the connection pool settings using oracle.jdbc.pool.OracleDataSource . However it seems the physical connections are not getting closed after use. I thought, Since it is connection pooling, the connections will be reused from the pool, so so many physical connections will not be made, but thats not what is happening now! There are 100+ active physical connections in the database generating from the application [not from plsql developer or any such

convert XMLGregorianCalendar to date i.e “MM/DD/YYYY hh:mm:ss AM”

陌路散爱 提交于 2019-12-04 15:15:12
问题 I have a date in XMLGregorianCalendar format like "2013-05-16T09:54:13" which i have to convert to timestamp "MM/DD/YYYY hh:mm:ss AM" for inserting into oracle database table using java. how can i do this in Java? 回答1: You can do this to return a Date : calendar.toGregorianCalendar().getTime() I found that code from this tutorial. From there, you can use a SimpleDateFormat to turn it into a string in the format you want. But, if you're using JDBC to save the date in the database, you probably

Return Message of Error code in Oracle Stored Proc

流过昼夜 提交于 2019-12-04 14:22:43
The below procedure (in Oracle 11g release 1) accepts a sql as a parameter & returns its return code. Returns 0 if success Returns 1 if no update or no delete performs Returns actual error code in case of failure. How can I change below procedure to return me another out param say "return_message" which will contain short description of oracle internal error message? In case of success, it should say "success" and in case no delete/updates performed, it should say "nochange" CREATE OR REPLACE PROCEDURE "demo"."run_demo"(v_sql IN VARCHAR2, return_code OUT number) AS i number; BEGIN return_code

Oracle UpdateXML() changes XML structure?

自古美人都是妖i 提交于 2019-12-04 14:22:39
When I call UpdateXML() I find that empty nodes are being converted to shorthand XML. Is there a way to prevent UpdateXML() from behaving this way, perhaps a flag or setting or alternate XPath expression to tell it to preserve the original structure? /* Example 1 */ SELECT UpdateXML(xmlData, '/TEST/VALUE/text()', 'hello') as "Example 1" FROM (SELECT XMLType('<TEST><VALUE>hi</VALUE></TEST>') as xmlData FROM DUAL); Example 1 --------- <TEST><VALUE>hello</VALUE></TEST> /* Example 2 */ SELECT UpdateXML(xmlData, '/TEST/VALUE/text()', 'hello') as "Example 2" FROM (SELECT XMLType('<TEST><VALUE><

Is “NUMBER” and “NUMBER(*,0)” the same in Oracle?

此生再无相见时 提交于 2019-12-04 13:24:32
问题 In Oracle documentation it is mentioned that NUMBER (precision, scale) If a precision is not specified, the column stores values as given. If no scale is specified, the scale is zero. But NUMBER (without precision and scale) is also accepting floating point numbers (34.30) but according to documentation if scale is not specified it should be zero scale by default so it should allow only integers, am I wrong?. And in another questions it is mentioned that default precision is 38, default scale

Oracle data masking

瘦欲@ 提交于 2019-12-04 13:17:42
We have one requirement to mask a particular table column using a Oracle function which gives persistent masked output string. We tried Oracle Hash Function but it does not give String type return value. We tried Oracle Random function (dbms_random.string) but it does not give Persistent output string. I read on internet that this is called deterministic masking. But we do not want to use Oracle Enterprise Manager; however we require a direct Oracle function. Please suggest. This problem is easily solved in 12c with the function STANDARD_HASH . The solution in previous versions is only

Insert xmltype into xmltype in specified place [PL/SQL]

百般思念 提交于 2019-12-04 13:02:51
I have problem with insert xmltype into another xmltype in specified place in pl/sql. First variable v_xml has the form: <ord> <head> <ord_code>123</ord_code> <ord_date>01-01-2015</ord_date> </head> </ord> And the second v_xml2: <pos> <pos_code>456</pos_code> <pos_desc>description</pos_desc> </pos> My purpose is get something like this: <ord> <head> <ord_code>123</ord_code> <ord_date>01-01-2015</ord_date> </head> <!-- put the second variable in this place - after closing <head> tag --> <pos> <pos_code>456</pos_code> <pos_desc>description</pos_desc> </pos> </ord> What shoud I do with my code?

Recursive SQL giving ORA-01790

好久不见. 提交于 2019-12-04 12:55:33
问题 Using Oracle 11g release 2, the following query gives an ORA-01790: expression must have same datatype as corresponding expression: with intervals(time_interval) AS (select trunc(systimestamp) from dual union all select (time_interval + numtodsinterval(10, 'Minute')) from intervals where time_interval < systimestamp) select time_interval from intervals; The error suggests that the datatype of both subqueries of the UNION ALL are returning different datatypes. Even if I cast to TIMESTAMP in

WARNING: Error while registering Oracle JDBC Diagnosability MBean

早过忘川 提交于 2019-12-04 12:53:31
We are getting the following error when using Oracle 11g ojdbc6.jar: WARNING: Error while registering Oracle JDBC Diagnosability MBean. java.lang.NoSuchMethodError: javax.management.StandardMBean.<init>(Ljava/lang/Class;Z)V at oracle.jdbc.driver.OracleDiagnosabilityMBean.<init>(OracleDiagnosabilityMBean.java:34) at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:342) at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199) After investigating from many forums and blogs, we have not found any final solutions yet. So, we want to share the workaround way here. totolearning

Laravel dosen't connect with Oracle

我们两清 提交于 2019-12-04 11:49:19
I'm using yajra/laravel-oci8 for Oracle connection with laravel. But I couldn't connected to Oracle, from my client PC to Server. showing this error: I'm using this code in database.php: 'oracle' => array( 'driver' => 'oracle', 'host' => '192.168.152.189',// this is my server IP 'port' => '1521', 'database' => 'ocp', 'username' => 'ocpl', 'password' => '123456', 'charset' => 'AL32UTF8', 'prefix' => '', 'port' => 1521 ), But I'm connected with Sql Developer. see the Sql-Developer Property: problem in this line : 'database' => 'ocp' , solve it with : 'database' => 'orcl' , or 'database' => '192