CallableStatement does not run PL/SQL with jdbc:oracle:thin driver
I have a very simple PL/SQL function:
FUNCTION CalculateDistance
(x1 IN NUMBER, y1 IN NUMBER, x2 IN NUMBER, y2 IN NUMBER)
RETURN NUMBER
AS
distance NUMBER;
BEGIN
distance := SQRT(POWER(x1-x2,2) + POWER(y1-y2,2));
return distance;
END;
I call it with:
CallableStatement cs = null;
try {
biomassStatement = con.prepareCall("{ call MYPACKAGE.CalculateDistance(?, ?, ?, ?, ?)}");
cs.setDouble("X1", -367546.78402892);
cs.setDouble("Y1", 150712.8161204);
cs.setDouble("X2", -2155095.49289);
cs.setDouble("Y2", 774013.149084);
cs.registerOutParameter("v_Return", OracleTypes.NUMBER);
cs.execute();
The only answer I get is:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'CALCULATEDISTANCE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
I tried it with different Data sources (common, pool, XA) and nothing works...
Tried using ojdbc14_g.jar to see if could get more information with no help...
HELP!!!
Hi,
You are calling a FUNCTION, i.e you have one return value (And four arguments)
So according to javadocs
http://download.oracle.com/javase/6/docs/api/java/sql/CallableStatement.html
Your synbtax should be like:
{?= call <procedure-name>[(<arg1>,<arg2>, ...)]}Rigtht now, your call seems to be for a procedure having five arguments.
Regards
Peter
Similar Messages
-
Web Logic 6.1 JDBC Pooling with the Oracle Thin Driver
Hi,
We're slowly getting through a WebLogic 4.5.1 to 6.1 conversion for a small application
at my company. Initially, we had trouble getting the Oracle thin driver working.
We've finally cracked this nut. Now we're trying to get pooling working, and
cannot find an example of doing this with the Oracle thin driver.
Would anyone be able to provide:
1. the portion of the config.xml that pertains to building a connection pool using
the Oracle thin driver
2. the two lines of code for loading the driver and getting a connection from
this pool
i.e.
Driver d = (Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection c = d.connect("jdbc:weblogic:pool:myPool", null);
Thanks very much!
Jeff Ryan
The Hartford"Jeff Ryan" <[email protected]> wrote:
>
1. the portion of the config.xml that pertains to building a connection
pool using
the Oracle thin driver
You don't usually edit the config.xml unless it is absolutely necessar. Instead,
you can config the pool in the GUI admin console, quite easily. After you successfully
configed the pool in the console, it is written into the config.xml file for you.
Only thing special when config the pool is the name of the driver and the url.
url: jdbc:oracle:thin@dbhost:dbport:dbinstance
driver: oracle.jdbc.driver.OracleDriver
If you prefer, you can also config the pool from the command line. It is detailed
in the "Weblogic Server Command-line Interface Reference".
2. the two lines of code for loading the driver and getting a connection
from
this pool
i.e.
Driver d = (Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection c = d.connect("jdbc:weblogic:pool:myPool", null);
Again, you don't use the connection directly. Instead, you use "Data Source".
Data source in weblogic is just a connection object factory associated with a
JNDI name. You can therefore lookup the data source with the JNDI name and from
the data source object, you get the connectin object. No need to explicitly load
the driver class.
There are plenty of example codes available in the weblogic examples installed
with 6.1, that uses the data source.
Charles -
Connection reset using JDBC Oracle thin Driver (towards 10g DB)
Hi we have a home-grown application and a Oracle 10g (10.2.0.1) database.
We created a scheduled servlet that gets a JDBC connection from a persistent connected cache (an OracleDataSource object registered using OracleConnectionCacheManager). The servlet runs every 15 minutes and runs the query "SELECT SYSTIME FROM DUAL" on 10g Database as XYZ user. The datapool was created yday on web-app and all queries ran successfully for about 5 hours after which it reported a connection reset error.
I can then conclude that we cannot keep the server session alive for the JDBC client by running frequent SQL queries.
We didnt get any messages on the DB server side that indicate the release of the session
Ultimately, we are struggling with reset connections from our applications that are
using the JDBC thin oracle driver; after a couple of hours of idle
connections, we receive the below error from the JDBC driver:
Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError throwSqlException
WARNING: DatabaseError.throwSqlException(e): Unable to find ORA number from
exception Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError
findMessage
WARNING: DatabaseError.findMessage(errNum, obj): returned Io exception:
Connection reset Jul 5, 2007 10:59:53 AM
oracle.jdbc.driver.PhysicalConnection getWarnings
INFO: PhysicalConnection.getWarnings()
Any suggestions please ?
VkThe code itself is fine; the problem is with one of:
1) the connection URL
2) intermediate networking
3) the database itself
1) your connection URL is "jdbc:oracle:thin:@127.0.0.1:1521:orcl"
- is Oracle really running on the default port, 1521
- is the installation SID really "orcl"
2) lots of possibilities, but only a couple are likely
- is TCP/IP configured and running on your host
- is there a persoanl firewall rpduct running? perhaps it's blocking the connection
3) Is Oracle running?
Is the listener running? -
How to set a sql query time out with jdbc:oracle:thin
should i change the JDBC driver with jdbc:oralce:XA:thin or other driver with XA?
SQL query timeout may be set with setQueryTimeout.
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#setQueryTimeout(int)
A query timeout bug is fixed in Oracle JDBC Drivers release
10.1.0.2.0 (10g)
FIXED BUG-2249191
In the Server Internal Driver, setting the query timeout does not
+(and likely will never) work. The query execution will not be+
canceled when the timeout expires, even if the query runs forever.
Further, after the query returns, the execution of your code
may pause for the length of the timeout.
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_readme101020.html -
Best Practices for JDBC with RAC Oracle Thin Driver non-XA Weblogic
Does anyone have experience on setting up your application server's JDBC connection pools for RAC?
We are using Weblogic 10 which supports load-balancing between connection pools at the application level, but I believe the listener is load-balanced on the Oracle CRS side as well.
Is this recommended / not-recommended?We use JDBC connection pool. However the load balance
configured at the database. JDBC uses load_balance=on
in the connection string. It works fine. I haven't
tried integrating FAN option and app server.
You may refer this doc on load balance.
http://www.oracle.com/technology/products/database/clu
stering/pdf/twpracwkldmgmt.pdf
AshokWhat type of application server are you using? -
Itunes 7.1 does not run. Issue with your audio config detection
Hi,
Since I updated to itunes 7.1 the following error message comes up each time I start the program "Itunes cannot run because it has detected a problem with your audio configuration" This happened for the first time right after the update and I have tried to downgrade to the previous version (which was working fine) but now this error occurs with previous version too.
My sound card is a creative sound blaster x-fi and I don't see anything wrong with its configuration.
The OS is Vista premium
Thanks to anyone who can help me with this.
DELL Dimension E520 Other OS Vista and creative sb x-fithe following error message comes up each time I start the program "Itunes cannot run because it has detected a problem with your audio configuration"
typically that's caused by a broken QuickTime. (iTunes uses QuickTime for audio and video playback.) see the following document for troubleshooting instructions:
iTunes 7 for Windows: iTunes had detected an audio configuration problem -
Imovie video does not run on PC with quick time!!!
I have produced a video on a Mac with imovie V 9.0.8 and exported via Quicktime. I tried to view the video on a PC with quicktime 7.7.3. Unfortunately this is not possible!! A simple link to a page with a number of third party suppliers should help! I do not have time and motivation to search in the jungle of codecs and secrets to find a correct solution. I do not understand apples policy. It is the most difficult thing to make a video and find a format that can be read with current software.
What can be done?I have produced a video on a Mac with imovie V 9.0.8 and exported via Quicktime. I tried to view the video on a PC with quicktime 7.7.3. Unfortunately this is not possible!! A simple link to a page with a number of third party suppliers should help! I do not have time and motivation to search in the jungle of codecs and secrets to find a correct solution.
What codec did you use for the export? I.e., It is most likely the video codec used for your export is causing the problem as it may not be included in the basic QT codec component package. (E.g., the Apple Intermediate Codec is only available on the Mac.)
I do not understand apples policy. It is the most difficult thing to make a video and find a format that can be read with current software.
If you exported the file for playback on a PC and selected or allowed a defaulted codec not available for the PC to be used, then the problem is self-inflected. The normal export combination would be H.264/AAC in an MOV, MP4, or M4V file container. Assuming the file was properly terminated and transferred between systems, any of these files should be playable in QT on your PC (as well as other third-party players like VLC, MPEG Streamclic, etc.)
What can be done?
The best option would probably be to re-export the project to any format known to be compatible with your PC QT install. -
How do i fix it
Hi 8tharmy,
It's hard to tell what this error triggered, Best approach will troubleshooting the issue and narrow down to the root cause. Best KB provided by Adobe you find here.
Windows: https://helpx.adobe.com/x-productkb/global/troubleshoot-system-errors-freezes-windows.html
Mac: Troubleshoot system errors, freezes | Mac OS 10.x | Adobe software
If you like help please share some additional information in this topic or share the result and the issue statement with Adobe support. Learn & Support -
Montly depreciation simulation does not run for asset with custom depr keys
Hello!
Some assets in report S_ALR_87012936 display annual depreciation simulation even if only a period of the year is selected. For those assets a custom depreciation keys is defined. Is that a problem?
Could I found a way to simulate depreciation for a part of the year for those assets yet?
Thanks
Giovannahi,
ccheck your settings in trx. S_ALR_87009113
A. -
Has anyone had this scanner working with the Apple drivers? Mavericks still adds this scanner and even gives it the correct icon in the dock. But, the CYMK channels are offset making the output images unusable. Surely this must be a driver fault which has been long standing, before Mavericks. I get the impression it is a generic driver that just maybe recognises an epson scanner and just does what it always does without taking too much care to adapt to the scanner itself. Such as shame as the Apple scanning software is otherwise very good.
Anyone know how to inform Apple they have a problem with the driver? Just to let them know...
Of course there is handmade solution by using Photoshop and move channels each other but frankly...
Here are sample scans which demonstrates the problem, one on mac through Image Capture:
… and just to compare, the sample I did in Paint (virtual Windows machine under OSX): -
ORA01002 with Oracle thin driver - not with JDriver
Hi,
I use weblogic 5.1 SP10. I was using the weblogic JDriver to create a connection
pool for my entity beans with BMP. I switched from the weblogic Jdrivers to using
the Oracle thin driver (classes12.zip) for my connection pool. Now i get a ORA-01002
(fetch out of sequence) for my ORACLE 8.1.6 SELECT FOR UPDATEs. I can solve this
by - explicitly setting autocommit to false for the connection. This is within
in the EJB transaction.
Why I have to do this with the Oracle thin driver and not with the Weblogic JDriver
Any thoughts on this are appreciated !From this I assume that you know what you are doing but I have to ask, are you
using the TxDataSource to obtain the connection in your BMP entity beans? If
so, I would talk to support...
Anand wrote:
Hi Robert,
I am using the TxDataSource in the workout.properties file.
eg:
weblogic.jdbc.TXDataSource.MyDBPool =MyDBPool
The connection pool is defined as below:
weblogic.jdbc.connectionPool.MyDBPool =\
driver=oracle.jdbc.driver.OracleDriver,\
url=jdbc:oracle:thin:@localhost:1521:MyDb,\
loginDelaySecs=1,\
initialCapacity=10,\
maxCapacity=20,\
capacityIncrement=2,\
allowShrinking=true,\
shrinkPeriodMins=15,\
refreshMinutes=10,testTable=dual,\
props=user=admin;password=password
Robert Patrick <[email protected]> wrote:
How are you obtaining the connection from the pool? Make sure you are
using a
TxDataSource...
Anand wrote:
Hi,
I use weblogic 5.1 SP10. I was using the weblogic JDriver to createa connection
pool for my entity beans with BMP. I switched from the weblogic Jdriversto using
the Oracle thin driver (classes12.zip) for my connection pool. Nowi get a ORA-01002
(fetch out of sequence) for my ORACLE 8.1.6 SELECT FOR UPDATEs. I cansolve this
by - explicitly setting autocommit to false for the connection. Thisis within
in the EJB transaction.
Why I have to do this with the Oracle thin driver and not with theWeblogic JDriver
Any thoughts on this are appreciated ! -
Add does not run with sql server 2008
Hi all,
My add on in the development environment does not run with SQL SERVER 2008. It ran well with SQL Server 2005 and sap b1 2207 B.
On executing the project file system throws an error "YOU ARE NOT CONNECTED TO THE COMPANY"
we are trying this scenario on a test machine where SAP B1 2007B with temporary license for one month and SQL server 2008
is installed.
Help needed.
Thanking you
PradnyaHi Use this
Dim i as integer
i=oCompany.Connect()
if i<> 0 Then
msgbox(ocompany.GetLastErrorDescription ())
end if
the you will get the error description also use try catch wherever necessary
Alternatively you can use
Dim SboGuiApi As SAPbouiCOM.SboGuiApi
Dim sConnectionString As String
Set SboGuiApi = New SAPbouiCOM.SboGuiApi
sConnectionString = Command
SboGuiApi.Connect sConnectionString
Set SBO_Application = SboGuiApi.GetApplication()
Set ocompany = New SAPbobsCOM.Company 'initialate DI company object
ocompany = SBO_Application.Company.GetDICompany
HTH,
Atul -
premiere elements 12, new installation, serial no. accepted, installation completed and new started, but does not run. I get following msg-box: "LoadLibrary failed with error 126: Das angegebene Modul wurde nicht gefunden." Installation in German Language on WIN7 professional 64bit, Samsung SSD. What can I do to run that program?
Jurgen Freund
Premiere Elements 12 on Window 7 64 bit. What video card/graphics card does your computer use - AMD Radeon?
I have found this YouTube video on the subject of Error 126 with details for resolving the problem.
How to fix the ERROR 126 when you open OpenGL programs - YouTube
The link was contributed in an old 2013 thread here by the ID danneomarre (see post 6 of the following thread)
LoadLibrary failed with error 126: cant find the required
Please let us know if that worked for you.
Thank you.
ATR
Add On...When all is OK and working, please update 12 to 12.1 Update using an opened project's Help Menu/Update. -
Task does not run with transaction currency
Dear All,
When i am executing IU AR/AP elimination, I am getting error " Task does not run with transaction currency ("per TC" option reset) "
Message no. UCF5104
Diagnosis
The present task is configured so that no values are analyzed in transaction currency. However, the option "per transaction currency" is selected in the method definition. This only makes sense if you also want to analyze the values in transaction currency.
System response
The task is being executed without the option "per transaction currency".
Please advise me how to resolve the issue.
Regards,
MalaniDear Dan,
I would like to know what will be the effect if we remove o-Per Currency option in Method.
I would like to know, in the document also in properties tab - in Key figures - Check box - Transaction Currency. If i select the warning message not coming. So kindly let me know what exactly check box -Transaction currency is used in Document type and whether it is interlinked with Method.
Thanks
Malani -
i m working in an organization where web-sense is installed to block all irrelevant sites, i have installed itunes but it does not run a window pops up with message 'itunes is not connected to the network' can anyone help me out?
There's a whole lot to read in your post, and frankly I have not read it all.
Having said that, this troubleshooting guide should help:
http://support.apple.com/kb/TS1538
In particular, pay attention to the mobile device support sections near the bottom, assuming you have already done the items above it.
Maybe you are looking for
-
Java.sql.Date and java.util.Date - class loaded first in the classpath
I had two jar files which has java.util.Date and java.sql.Date class file. i want to know whether which class is loaded first in the classpath... I like to change the order of loading the class at runtime... Is there is any way to change the order of
-
Mobility Service Engine without Client or Tag licenses
What does the base MSE box get you when you do not have any additional feature licenses? Do I still get rogue AP location mapping and history?
-
Enterprise portal system monitoring.
Hi Experts, Can you provide information day to day monitoring for EP system. Regards, Harish.B
-
File Browser/Library window wont appear
My file browser/ library window won't appear, it's gone? I tried checking and unchecking them under the window pull down menu.No Luck. I have all the latest updates Anyone have any ideas? THX
-
Airport icon turned grey, no networks shown
G4 Quicksilver running 10.4.11 Last night after several years trouble free operation Airport on my wife's G4 suddenly started cutting out and then coming back in. Sometimes it was off for a few seconds, sometimes for a few minutes. Restarting didn't