JDBC Refcursor error
I am trying to access a procedure returning refcursor. It works great in TOAD.
Except when I try to access JDBC driver throws wierd error stating. This error shows at the execute statement
java.lang.StringIndexOutOfBoundsException: String index out of range: 37
at java.lang.String.charAt(String.java:444)
at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:1123)
I had turned the debug on and the messages give very little information.
Here is the sample
OracleCallableStatement stmt =
(OracleCallableStatement)connection.prepareCall(
"{call my_test1.process_orders(?)"; );
stmt.registerOutParameter(1, oracle.jdbc.OracleTypes.CURSOR);
stmt.execute();
Thanks for your replies
Message was edited by:
saro28
Hi,
Is this line of code correct?
"{call my_test1.process_orders(?)"; );It should read something like:
"{call my_test1.process_orders(?)}" );The code shown here is missing the closing brace and has an extra semi-colon.
- Mark
Hi,
Is this line of code correct?
"{call my_test1.process_orders(?)"; );It should read something like:
"{call my_test1.process_orders(?)}" );The code shown here is missing the closing brace and has an extra semi-colon.
- Mark
Similar Messages
-
ADF: Gracefully handling JDBC connection errors? Part II
Hi gang
I while back I posted a forum post to find a solution to "display a specific web page when the JDBC connection drops out on our ADF application, specifically the following error: oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection"
...you can see the original post here:
Re: ADF: Gracefully handling JDBC connection errors?
For the life of me I can't get this to work now. It appears I can't redirect to another page during the call to reportException. I've had a play with different methods of redirecting, as seen in the following code sample:
public class ErrorHandlerImpl extends DCErrorHandlerImpl {
public ErrorHandlerImpl() {
super(true);
@Override
public void reportException(DCBindingContainer dCBindingContainer, Exception exception) {
// try {
String message = exception.getMessage();
if (message.indexOf("JBO-26061") >= 0) {
// Method 1
FacesContext fc = FacesContext.getCurrentInstance();
UIViewRoot viewRoot =
fc.getApplication().getViewHandler().createView(fc, "faces/errorPage.jspx");
fc.setViewRoot(viewRoot);
fc.renderResponse();
// Method 2
// FacesContext fc = FacesContext.getCurrentInstance();
// fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "goError");
// fc.responseComplete();
// Method 3 - required IOExcepition handler
// FacesContext.getCurrentInstance().getExternalContext().redirect("faces/errorPage.jspx");
} else
super.reportException(dCBindingContainer, exception);
// } catch (IOException e) {
}... with no success.
Has anyobody any other solutions or advice on getting this to work?
Your help appreciated.
Thanks & regads,
CM.
PS. JDev 11gR1 ADF BC + ADF Faces RCHi Frank
Yep, I' tried redirect, that was method 3 (you can see all 3 methods I've attempted, last 2 are commented out).
With the declarative ADFc exception handler, problem is it's a catch all, not specifically for JBO-26061. Can you think of a way I can tailor fit it for JBO-26061 with a custom message "Database down"?
In addition the exception handler is not consistently called. As example, if you're moving between pages rather than operating on 1 page, the standard af:messages error dialog is shown if the db connection has been dropped, rather than navigating to the exception handler page. As such it seems the DCErrorHandlerImpl.reportExceptions is the better chokepoint to work from.
Cheers,
CM. -
Hi All,
We have an interface that XI picked the data from sender side and need to post into database, here at database side my client is having 5 diff plants so we designed a BPM in that based on plant num BPM deceides to send data to respected plant. out of 5 plants 4 plants data inserting is executing sucessfully, but for one plant its failing to insert data and getting timedout error irrespective of data volume ..i mean one day its sucessfully exectuing insertion for large volume but next day its failing to insert the less volume data compare to last days large volume....
waiting for ur valuable suggestions to overcome this jdbc timeedout error.
rgrds
sri
Edited by: sri_rambo on Jul 24, 2009 8:58 AMHi Sri,
Kindly Refer for the following SAP Note 831162 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter
https://service.sap.com/sap/support/notes/831162 (Page No.12, Q.No.28)
For setting the Maximum Concurrencies & Pool Waiting Time;
This will be solved your issue immediately.
Regards
Venkat Rao .G -
Hello,
I've downloaded MySQL Connector/J 3.0 zip file for the windows box.when I unzipped, had a directory, mysql-connector-java-3.0.10-stable and inside it I had this mysql-connector-java-3.0.10-stable-bin.jar file.I copied this file to j2sdk1.4.1_02/jre/lib/ext and when i try to run the following program, it throws me with error.Any ideas???
Thanks in advance.
public class test {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
System.out.println("Good to go");
} catch (Exception E) {
System.out.println("JDBC Driver error");I'm guessing it can't find the class, although your code doesn't print any details of the exception. Run a program containing this line of code:System.out.println(System.getProperties().getProperty("java.ext.dirs"));That will tell you where you need to put the jar file.
-
A jdbc transaction error occur
Hi Everybody
A jdbc transaction error occur when I deploy the application on the server .
Below is the stack trace
#SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot commit transaction from this connection of "YTSQLS2K" DataSource. This resource participates in a local or distributed transaction.
#SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot initiate transaction from a connection of "YTSQLS2K" DataSource. Local or distributed transaction has already started.
#SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot commit transaction from this connection of "YTSQLS2K" DataSource. This resource participates in a local or distributed transaction.
Any idea about it
I use the jdbc version in datasource <jdbc-1.x>
is there a need to replace it with <jdbc-2.0>
Thank You
Syed SaifuddinHibernate allows you to choose transaction manager. As Nikolay pointed out, in a JEE envirnment it's prefferable to use JTA transactions. All you need to do is to configure hibernate to use a JTA transaction manager. It is all written in the Hibernate documentations. See
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-j2ee
and
http://www.hibernate.org/42.html#A5 .
The relevant properties that need to be set in the configuration are:
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
and
hibernate.transaction.manager_lookup_class=<Class that knows how to lookup>
You need to implement a class that knows how to lookup user transaction in SAP J2EE Egnine.
The class must extend org.hibernate.transaction.JNDITransactionManagerLookup and only override its abstract method getName (simply returning the lookup string). Then provide the fully qualified name as value of the property and make sure that Hibernate can load the class.
That should work.
HTH
-Georgi
Message was edited by:
Georgi Pavlov -
Jdbc thin error : The Network Adapter could not establish the connection
jdbc thin error : The Network Adapter could not establish the connection
I have been able to create a webservice as per the article Build a PL/SQL Web Service by jason price from otn website. while executing url to call the pl/sql procedure to get the data i am encountering this error
The Network Adapter could not establish the connection in the resultant xml output. Am I missing something here ?
Please see ouput below
<?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <SOAP-ENV:Body>
- <SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server.Exception:</faultcode>
<faultstring>java.sql.SQLException: Io exception: The Network Adapter could not establish the connection</faultstring>
<faultactor>/plsqlsample/dbfunc</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope
my oc4j/j2ee/home/config/data-sources.xml file has this entry for the connection
<data-source class="com.evermind.sql.DriverManagerDataSource" connection-driver="oracle.jdbc.driver.OracleDriver" ejb-location="jdbc/hr_connDS" inactivity-timeout="30" location="jdbc/hr_connCoreDS" name="jdev-connection:hr_conn" password="xxxx" pooled-location="jdbc/hr_connPooledDS" url="jdbc:oracle:thin:@o11idev.concentra.com:9200:DEV1" username="hr8" xa-location="jdbc/xa/hr_connXADS"/>
I am not able to debug this error and any information to debug this error would be appreciated. I have scanned the metalink short of logging a tar. I am using the oc4j install on the 9ias webserver and not the jdeveloper/oc4j combination. The apps server runs 9ias on hp/ux.
Thanks
ashokAshok,
Your database connection URL doesn't look right to me. The default database connection listener port is 1521 (not 9200). You can check this using the "lsnrctl" utility.
To find the "host" and SID parts (of the URL), use the following SQL query:
select HOST_NAME, INSTANCE_NAME from V$INSTANCEGood Luck,
Avi. -
Configure JDBC DataSoure Error
Hi,
I have successfully created a JDBC Connection Pool and DataSource.
However, when I try to assign the datasource into the server. I get an error (shown
below). I have been using weblogic user to admin all the components. I really
don't understand why the error says that weblogic user doesn't have the permission.
I saw someone ask this question before, but no one responsed.
Any advise ??
thanks
<Error> <JDBC> <001059> <Error during Data Source creation: java.lang.RuntimeException:
User "principals=[weblogic]" does not have permission for OracleConnectionPool.I am assuming you are using JDeveloper 3.2x
Please see the online help for additional details.
Search help for "JDBC Connection Properties" - With the
quotations and you will find a page names "JDBC Connection
Properties"
This page contains the following info and additional links.
-John
------------- COPIED FROM HELP ---------------
Oracle JDBC-OCI8 Driver
Use this type 2 driver when creating a Java application that
runs against an Oracle8i server. This is a thick driver
optimized for the Oracle8i database: it cannot be used with
applets. This driver handles any database protocol (TCP, IPX,
BEQ, and so on). It is required for applications which are run
from the machine they are stored on. It can also be used against
an Oracle7 database.
This driver requires client software installation. The project
must also include the correct version of the driver in a library
and include no other Oracle JDBC library. This driver is
included in the default Oracle JDBC library for all projects.
The library is named Oracle 8.1.7 JDBC and it includes both the
Thin JDBC and JDBC-OCI8 driver library components. For all OCI
and type 2 JDBC drivers, see Connection Requirements for OCI and
Type 2 JDBC Drivers.
------------- COPIED FROM HELP --------------- -
[BEA][SQLServer JDBC Driver]Error
hi
i am veeresh.s, in 1 of our user this below error has came,i am a fresher, i don't know how to resolve it, please any body help me in resolving this error
user gets the following error message when the user try to create a connection pool to connect user weblogic server to oracle server.
Error:
[BEA][SQLServer JDBC Driver]Error establishing socket to host and port: dt2888-swaminat:1433. Reason: Connection refused: connect
The Network Adapter could not establish the connection
user is unable to telnet to that machine. user suspect that it to be some driver issue.
So what may be the problem,
please look into the problem and Kindly help me in resolving this issue.This appears to be a duplicate thread. I posted a reply in the other forum
Re: [BEA][SQLServer JDBC Driver]Error
Justin -
JDBC gives error if accessing Package Synonym
Calling a stored procedure in a package using JDBC...
Where we are using a synonym for our package (given all permissions are OK - I've even tried SYSDBA) rather than calling procedures directly in the package, we get the error 'table or view does not exist'.
This error only occurs for procedures in the package which return ref cursor type (i.e. a recordset), otherwise the procedure seems to execute fine.
The same procedures can happily be used via ODBC and OLEDB using the synonym, so I suspect it is JDBC at fault.
We do need to use a synonym (I like to keep nice clean tidy schemas!) so if anyone knows how to get around it or whether the bug will be fixed shortly please let us know.
Regards
Jason.
nullHi,
Returning refcursors from Java stored proc feature is planned for JDBC 8.2.
Hope this helps,
-Kishore -
Loading big XML files using JDBC gives errors
Hi,
I've created a XMLType table using binary storage, with the restriction that any document stored has a (any) schema:
CREATE TABLE XMLBIN OF XMLTYPE
XMLTYPE STORE AS BINARY XML
ALLOW ANYSCHEMA;Then I use JDBC to store a relatively large document using the following code:
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String connectionString = "jdbc:oracle:thin:@host:1521:sid";
File f = new File("c:\\temp\\big.xml");
Connection conn = DriverManager.getConnection(connectionString, "username", "password");
XMLType xml = XMLType.createXML(conn,new FileInputStream(f));
String statementText = "INSERT INTO xmlbin VALUES (?)";
OracleResultSet resultSet = null;
OracleCallableStatement statement = (OracleCallableStatement)conn.prepareCall(statementText);
statement.setObject(1,xml);
statement.execute();
statement.close();
conn.commit();
conn.close();Loading a file of 61Mb (real Mb, in non-IT Mb (where 1Mb seems to be 10^6) it is 63.9Mb) or less doesn't give any errors, loading a file bigger then that gives the following error:
java.sql.SQLRecoverableException: Io exception: Software caused connection abort: socket write error
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:458)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:960)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3482)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3856)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1373)
at jdbctest.Tester.main(Tester.java:60)A succesful insert of a 63Mb file takes about 23 seconds to execute. The 70Mb file fails already after a few seconds, so I'm ruling out any time outs.
I'm guessing there are some buffers that need to be enlarged, but don't have a clue which ones.
Anyone any idea what might cause the problem and how to resolve?
My server runs Oracle 11g Win32. The client is Windows running Sun Java 1.6, using ojdbc6.jar and Oracle 11g Client installed.
Cheers,
HaraldHi Mark,
The trace log in the OEM shows me:
Errors in file d:\oracle11g\app\helium\diag\rdbms\helium\helium\trace\helium_ora_6948.trc (incident=7510): ORA-07445: exception encountered: core dump [__intel_new_memcpy()+613] [ACCESS_VIOLATION] [ADDR:0x0] [PC:0x6104B045] [UNABLE_TO_WRITE] [] If needed I can post the full contents (if I find out how, am still a novice :-))
Cheers,
Harald -
Error in adapterlog: JDBC connection error
Hi Experts,
I am getting this error during database connection to the database URL 'jdbc:sqlserver:// <servername>:1433;database=HRBD' using the JDBC driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:sqlserver://<servername>:1433;database=HRBD': com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection timed out'
I am able to connect this server from Microsoft SQL Server2005(Which does not require the port number) but when I am trying to connect from PI JDBC sender adapter ,I am getting this error.
It is a SQL Server.JDBC driver seems ok(com.microsoft.sqlserver.jdbc.SQLServerDriver) because I connected the Staging database server from PI but unable to connect to this production database.
After starting the channel ,after 5-7 minutes I am getting this error.
Need your help on urgent basis!!
regards
AnupamAnupam Ghosh wrote:
Hi Navin,
>
> I made a telnet test from putty giving the server name and port number and it showed me the "connection timed out".
> But I made telnet test to other database which resulted in successful connection.
> So is it a firewall issue with that particular databse?
> In that case only network team of that databse can handle this issue?
>
> Thanks,
> Jaydeep
Few things that mght help u
1. Check the port no for the DB that is getting timed out. .check
2. Disable the firewall. and check
3. Consult the N/w and the DB team.. .telling clearly the issue
Good Luck
XA -
Configtool Secure Store JDBC password - Error while connecting to DB
Hi All
I was following the note 701654 which asked to update the config tool secure store pssword. I changed the JDBC password too instead admin password alone. Now the problem is the config tool is not able to connect to the database and this lead to the jcontrol.exe to be stopped. We tried to give back the DB password we remembered unfortunately none of them worked. Please guide me to get around this.
Should I need to change the DB password if so please let me know the procedure and the places I need to do the change.
Thanks, RajThe problem was fixed. I changed the DB password directly in the SQL server and updated it in the secure store and it worked.
Note 997510 gave a good idea on the error and the solutions.
Thanks, Raj -
ADF: Gracefully handling JDBC connection errors?
Hi gang
We've a use case to display a specific web page when the JDBC connection drops out on our ADF application, specifically the following error:
oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
I've been researching solutions to this and came up with a near solution of placing the following entry in the application's web.xml file:
<error-page>
<exception-type>oracle.jbo.DMLException</exception-type>
<location>/MyErrorPage.jsp</location>
</error-page>This works okay but is a blunt mechanism as it captures all DMLExceptions which includes insert/update/delete failures, as well as the JDBC connection drop out.
Has anybody come up with a better solution for handling JDBC connection drop outs?
Thanks & regards,
CM.
PS. (JDev 11g build 5188, ADF BC + ADF Faces RC)Thanks John, that's the solution. For some reason I'd forgotten that DCErrorHandlerImpl exists in the controller layer, not the model layer, so it makes perfect sense to override it and do the redirect.
Here's what I came up with:
@Override
public void reportException(DCBindingContainer dCBindingContainer,
Exception exception) {
try {
String message = exception.getMessage();
if (message.indexOf("JBO-26061") >= 0) {
FacesContext.getCurrentInstance().getExternalContext().redirect("faces/ErrorPageJDBCFailure.jspx");
} else
super.reportException(dCBindingContainer, exception);
} catch (IOException e) {
}The following OTN post shows some other methods to do the redirect: JSF forward Vs redirect
Cheers!
CM. -
More precise JDBC driver error messages?
Hi,
is there a way to tell the Oracle JDBC driver (9.0.2.3) to provide more detailed error messages in an SQLException message string when a table cannot be found? The usual message "Table or view does not exist" does not provide information on the actual table or view that was missing. I would like the table or view name to be included in the message provided by the SQLException.
(In general I would appreciate more detailed error information in the Oracle JDBC driver exception messages.)
Best regards Uweperhaps this might help:
* Get error message of an SQLException with the following form:
* <p>
* <code>Code=<Vendor-specific error code>:'<error message>':SQLState=<SQLState></code>
* <code>
* Note: SQLState "S1000" is returned for general errors or if driver does not support SQLState.
* @param sqlException SQLException to create error code from.
* @return Specific error message or null if <i>sqlException</i> not available.
public static String toString(SQLException sqlException) {
String result = null;
if (sqlException != null) {
StringBuffer sb = new StringBuffer();
while (sqlException != null) {
sb.append("RDBMS Vendor Code ");
sb.append(sqlException.getErrorCode());
sb.append(": \"");
sb.append(sqlException.getMessage());
sb.append("\" : SQLState=");
sb.append(sqlException.getSQLState());
sqlException = sqlException.getNextException();
result = sb.toString();
}//else: input unavailable
return result;
}//toString()
* Get string representation of a SQLWarning.
* @param sqlWarning
* @return Specific error message or null if <i>sqlWarning</i> not available.
public static String toString(SQLWarning sqlWarning) {
String result = null;
if (sqlWarning != null) {
StringBuffer sb = new StringBuffer();
while (sqlWarning != null) {
sb.append("errorCode=");
sb.append(sqlWarning.getErrorCode());
sb.append(", SQLState=");
sb.append(sqlWarning.getSQLState());
sb.append(",message=");
sb.append(sqlWarning.getMessage());
sb.append(",cause=");
sb.append(sqlWarning.getCause());
sb.append(";");
sqlWarning = sqlWarning.getNextWarning();
}//next subsequent warning
}//else: input unavailable
return result;
}//toString() -
Remote JDBC connect error; missing SecStore.properties
Hi
After creating the intial context for a remote JDBC connection, using a Java client, to the J2EE engine, when calling createConnection(), I get the following error on ver 6.4:
com.sap.engine.services.dbpool.exceptions.BaseSQLException: ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException thrown by the physical connection:
com.sap.sql.log.OpenSQLException: Error while accessing secure store: File "SecStore.properties" does not exist although it should..
I can not find the file on the server, although what limited doco I can find suggests SecStore should be created at install time. Am I missing something here?
Thanks, LeonardTried, but no success. Am definitely connecting to jndi, getting the context etc. The issue seems to be here;
Caused by: com.sap.security.core.server.secstorefs.FileMissingException: File "SecStore.properties" does not exist although it should.
at com.sap.security.core.server.secstorefs.StorageHandler.openExistingStore(StorageHandler.java:372)
at com.sap.security.core.server.secstorefs.SecStoreFS.openExistingStore(SecStoreFS.java:1946)
at com.sap.sql.connect.OpenSQLConnectInfo.getStore(OpenSQLConnectInfo.java:803)
at com.sap.sql.connect.OpenSQLConnectInfo.lookup(OpenSQLConnectInfo.java:784)
at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:206)
Why is StorageHandler.openExistingStore trying to open SecStore.properties from the remote java client and not on the j2ee server? This makes no sense.
Thanks
Maybe you are looking for
-
Hi to all! It's my first post here. I just started my very first java class, and I have problem with my assignment. I have to write a program that accepts an integer # followed by a space and one letter, C or F. It should then convert number to oppos
-
IP In Use By...
I am moving into a new apartment. My wireless Internet has been connected there and I brought over my MacBook and I got the above error when I opened up my MacBook. What does this mean? The Internet there is terrible and it shouldn't be. It selective
-
Where to suggest new features for firefox!
Hi, Is there anywhere to suggest new features for Firefox? Thanks
-
The sound on my Iphone is not working, what should I do to get it fixed?
will the apple store fix this problem?
-
Is it possible to restore lost data from an app that was deleted then reinstalled?
I had a problem switching the accounts on ITunes and accidentally deleted an App, all of its data was deleted and when I repurchased the app(free app) I cannot access the games account. Their support won't let me solve it. Can I restore the lost data