Handling connection

How make connection from jboss-oracle pool...

package common;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import org.apache.log4j.Logger;
import rapaport.faErrorReport.FAErrorReport;
public class DBUtils
     public static final String DATASOURCE = "java:/PoolName";
     private static final Logger log = Logger.getLogger("DBUtils");
     private static int count = 0;
     public static Connection getConnection() throws Exception
          DataSource ds=null;
          try
               ds = getDataSource();
               log.info("open connections : " + (++count));
          catch(Exception se)
               log.error("getConnection(boolean isTransactional)"+se.getMessage());
          return ds.getConnection();
     private static DataSource getDataSource() throws Exception
          try
               if(nonTxDataSource == null)
                    // Get JNDI Context
                    Context jndiContext = new InitialContext();
                    nonTxDataSource = (DataSource)jndiContext.lookup(DATASOURCE);
          catch (NamingException ne)
               log.error("getDataSource(boolean isTransactional) throws Exception",ne.getMessage());
          return nonTxDataSource;
     public static void releaseResources(Connection con, Statement stmt, ResultSet result)
          try
               if(result != null){
                    result.close();
               if(stmt != null){
                    stmt.close();
               if(con != null){
                    con.close();
                    log.info("open connections/: " + (--count));
          catch(SQLException se)
          {   log.error("public static void releaseResources(Connection con, Statement stmt, ResultSet result)"+se.getMessage());
     public static void releaseResources( Statement stmt, ResultSet result)
          releaseResources(null, stmt, result);
     public static void releaseResources(Statement stmt)
          releaseResources(null, stmt, null);
     public static void releaseResources(ResultSet result)
          releaseResources(null, null, result);
     public static void releaseResources(Connection con)
          releaseResources(con, null, null);
} I think this will solve your query.

Similar Messages

  • How to handle connection to db problems using toplink

    Hi,
    We need to handle loss of db connection in our application. We use glassfish and toplink essentials (0.22). I suspect that a java RuntimeException is thrown by toplink. This is the code we use to access the db (mysql). The MyServiceImpl class is where I have my EntityManager to access my persistence entities. Is this the place to catch the RuntimeException? How can I handle it. Is it a reconnect I shall add to the code?
    //mike
    @Stateless
    public class MyServiceImpl implements MyService {
    private Logger log = Logger.getLogger(this.getClass().getName());
    @PersistenceContext(unitName = "myservice")
    private EntityManager manager;
    * For unit test, not exposed as a remote method
    * @param entitymanager
    * to use instead of default JTA manager
    public void changeEntityManager(EntityManager em) {
    log.finest("Changing entitymanager for unit test outside EJB container");
    this.manager = em;
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public User loginUser(String address, String password) throws LoginFailedException {
    log.finest("Login user " + address);
    return new UserDao(manager).loginUser(address, password);
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public String getSystemSetting(Setting setting) throws SettingNotFoundException {
    return new SettingDao(manager).getSystemSetting(setting).getValue();
    }

    I forgot to provide the code we are using to connect.
    @Stateless
    public class MyServiceImpl implements MyService {
    private Logger log = Logger.getLogger(this.getClass().getName());
    @PersistenceContext(unitName = "myservice")
    private EntityManager manager;
    * For unit test, not exposed as a remote method
    * @param entitymanager
    * to use instead of default JTA manager
    public void changeEntityManager(EntityManager em) {
    log.finest("Changing entitymanager for unit test outside EJB container");
    this.manager = em;
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public User loginUser(String address, String password) throws LoginFailedException {
    log.finest("Login user " + address);
    return new UserDao(manager).loginUser(address, password);
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public String getSystemSetting(Setting setting) throws SettingNotFoundException {
    return new SettingDao(manager).getSystemSetting(setting).getValue();
    }

  • Handling connection errors

    Hi,
    I'm working in a client/server application. The server side is EJB 3.0 based and the client side is a simple GUI with connection properties, everyone working in a different computer.
    Because of this, I want to handle all connection problems and report it to the user, by the moment I use to "throw" all errors up and then catch them and pop-up a message.
    For example, at the begining it builds a tree -using a treeviewer-, and if the program couldn't connect, it prints a message and asks to try again or cancel. Later there is a menu option where you can refresh this view.
    The problem is when I have been connected and I disconnect -manually- the network connection of the server, then I try to delete one of the tree objects -it needs to connect to the server for removing the entity- but in front of throwing a exception, it hangs and I have to kill the application and execute it again.
    The code that hangs:
    ------------------------------------- Start of code ----------------------------------------
    public class ComunicacioEJB {
         private static facadeEJB.RedFacadeRemote redfacade;
    public ComunicacioEJB() throws javax.naming.NamingException {
              c = Context();
    lookupRedFacade();
    private void lookupRedFacade() throws javax.naming.NamingException{
              /* exacly hangs here --> */ redfacade = (facadeEJB.RedFacadeRemote) c.lookup("RedFacade/remote");
    -------------------------------- End of code ------------------------------------------
    The context is loaded in another function.
    Do you have any idea of why is this happening? Why it throws if the connection problem is at the start of the program but hangs if the connection problem is once you have been connected before?
    Also it happens if I try to refresh the view or wharever I try.
    Thanks for reading.
    Miquel

    Hi again,
    I haven't found solution yet, but I'm thinking on having a timer or similar for the connection, once this timer ends the funcion throws an exception for timeout.
    I will try and I say to you

  • Handling connections on a server

    Hi,
    Im fairly new to multithreaded programming and I am creating a basic applet chat room. I have the basics working but im not sure how to go about handling the connections on the server. I was thinking about creating each connection on the server as a thread so that all incomming messages from different clients can be read at the same time. But I was wondering how would java cope if there were say a few hundred clients connected to the server, would java have trouble handling that many threads at the same time? The other way I thought would be to have just 1 thread for reading messages and 1 for sending messages which would loop through each connection reading 1 message at a time. Does anyone know which method would be best to use or have a more effecient alternative?

    If you're writing this for academic purposes, or to be used by a small group of friends or coworkers, the simple solution of one thread per connection will be fine. On even an average PC, a few hundred or even a thousand or more threads will not be a problem, unless the server in question is also providing some other service, so that threads may be a scarce resource.
    Having said that, a more robust a scalable approach would be to use a thread pool, and possibly a selector from the java.nio package. The basic idea is that, since not all clients are communicating all the time (It may seem like I'm working nonstop to type this message, but it's probably under a millisecond for my computer to package it up, and hand it off for delivery up to the Sun servers.), you can share threads among multiple connections.

  • Handling Connection Reset

    I have a app server box and a DB box .
    The code calls a stored proc on the DB. In between the execution of the procedure the connection between DB box and App server box is broken. What will be the state of the execution of procedure.
    I mean what will be the state of the DB.
    How can we handle this situation from Java JDBC ?

    well ..
    what i mean , wont it be in a orphan state .. like it
    doenst have a connection reference to it .
    It depends
    In case i have a autoCommit(true) .Will the proc
    commit ?
    It depends.
    And i dont have close on the calleable statement so
    will the
    session be still valid ?It depends. Although I don't really know what you mean by session.
    The answer is as the same as before. It depends on the transaction state (which you have indicated) AND the database (which you have not). Of course we don't know what your proc does either (regarding transactions) and how your database handles procs (wrapping them all in a transaction perhaps) and connection failures.
    So I would suggest that if you want to know what will happen with some certainty you should test.

  • How to handle Connection in a SLSB

    I am reading EJB in j2ee tutorial 1.4 and in the Bank example I saw that for each private method, first a connection is obtained then work is completed and then the connection is closed.
        private void updateChecking(double amount) throws SQLException {
            makeConnection();
            releaseConnection();
        private void updateSaving(double amount) throws SQLException {
            makeConnection();
            releaseConnection();
        public void transferToSaving(double amount)
            throws InsufficientBalanceException {
            checkingBalance -= amount;
            savingBalance += amount;
            try {
                updateChecking(checkingBalance);
                if (checkingBalance < 0.00) {
                    context.setRollbackOnly();
                    throw new InsufficientBalanceException();
                updateSaving(savingBalance);
            } catch (SQLException ex) {
                throw new EJBException("Transaction failed due to SQLException: " +
                    ex.getMessage());
        }Is this the recommended approach? I find it problemetic that one Logical Unit of Work "the transferToSaving() method" is opening and closing Connection twice.
    I am thinking that a better approach would be to get Connection in transferToSaving() method then pass Connection as an argument to both updateChecking() and updateSaving() methods.
        private void updateChecking(Connection conn, double amount) throws SQLException {
        private void updateSaving(Connection conn, double amount) throws SQLException {
        public void transferToSaving(double amount)
            throws InsufficientBalanceException {
            checkingBalance -= amount;
            savingBalance += amount;
            try {
                makeConnection();
                updateChecking(checkingBalance);
                if (checkingBalance < 0.00) {
                    context.setRollbackOnly();
                    throw new InsufficientBalanceException();
                updateSaving(savingBalance);
            } catch (SQLException ex) {
                throw new EJBException("Transaction failed due to SQLException: " +
                    ex.getMessage());
            } finally {
            releaseConnection();
        }Am i right? If yes then how come the guys at Sun are recommending a wrong approach?
    Thanks

    What is your question really about? You seem to be
    going in circles.
    Ok. Here is my question refined:
    I am reading SLSB EJB in j2ee tutorial 1.4 and in the Bank example I saw that for each business private method, first a connection is obtained then work is completed and then the connection is closed. For example:
    public class BankBean implements SessionBean, SessionSynchronization {
        private Connection con;
        public void transferToSaving(double amount) throws InsufficientBalanceException {
            checkingBalance -= amount;
            savingBalance += amount;
            try {
                updateChecking(checkingBalance);
                if (checkingBalance < 0.00) {
                    context.setRollbackOnly();
                    throw new InsufficientBalanceException();
                updateSaving(savingBalance);
            } catch (SQLException ex) {
                throw new EJBException("Transaction failed due to SQLException: " +
                    ex.getMessage());
        private void updateChecking(double amount) throws SQLException {
            makeConnection();
            String updateStatement =
                "update checking set balance =  ? " + "where id = ?";
            PreparedStatement prepStmt = con.prepareStatement(updateStatement);
            prepStmt.setDouble(1, amount);
            prepStmt.setString(2, customerId);
            prepStmt.executeUpdate();
            prepStmt.close();
            releaseConnection();
        private void updateSaving(double amount) throws SQLException {
            makeConnection();
            String updateStatement =
                "update saving set balance =  ? " + "where id = ?";
            PreparedStatement prepStmt = con.prepareStatement(updateStatement);
            prepStmt.setDouble(1, amount);
            prepStmt.setString(2, customerId);
            prepStmt.executeUpdate();
            prepStmt.close();
            releaseConnection();
        private void makeConnection() {
            try {
                InitialContext ic = new InitialContext();
                DataSource ds = (DataSource) ic.lookup(dbName);
                con = ds.getConnection();
            } catch (Exception ex) {
                throw new EJBException("Unable to connect to database. " +
                    ex.getMessage());
        private void releaseConnection() {
            try {
                con.close();
            } catch (SQLException ex) {
                throw new EJBException("releaseConnection: " + ex.getMessage());
    }Is this the recommended approach? I find it problemetic that one Logical Unit of Work "the transferToSaving() method" is opening and closing Connection twice.
    I am thinking that a better approach would be to first get Connection in transferToSaving() method then call both updateChecking() and updateSaving() methods and then close Connection in transferToSaving() method.
    So I would make following changes in the above code:
    public void transferToSaving(double amount) throws InsufficientBalanceException {
            checkingBalance -= amount;
            savingBalance += amount;
            try {
                makeConnection();
                updateChecking(checkingBalance);
                if (checkingBalance < 0.00) {
                    context.setRollbackOnly();
                    throw new InsufficientBalanceException();
                updateSaving(savingBalance);
            } catch (SQLException ex) {
                throw new EJBException("Transaction failed due to SQLException: " +
                    ex.getMessage());
            } finally {
                releaseConnection();
        private void updateChecking(double amount) throws SQLException {
            String updateStatement =
                "update checking set balance =  ? " + "where id = ?";
            PreparedStatement prepStmt = con.prepareStatement(updateStatement);
            prepStmt.setDouble(1, amount);
            prepStmt.setString(2, customerId);
            prepStmt.executeUpdate();
            prepStmt.close();
        private void updateSaving(double amount) throws SQLException {
            String updateStatement =
                "update saving set balance =  ? " + "where id = ?";
            PreparedStatement prepStmt = con.prepareStatement(updateStatement);
            prepStmt.setDouble(1, amount);
            prepStmt.setString(2, customerId);
            prepStmt.executeUpdate();
            prepStmt.close();
        }Am i right? If yes then how come the guys at Sun are recommending a wrong approach?
    Thanks

  • How to Handle Connection Informatin in a Multi-User Environment

    Hello,
    I am trying to setup SQL Developer on a Terminal Services box where multiple users will have access to use this tool. However, I have noticed that conenction details are shown globally on a Terminal Services box to anyone who has access to use SQL Developer.
    Is there a way to force these connection details to be stored in a user's Documents and Settings directory?
    Thanks in advance...
    Tom

    After digging through the forum a bit, I have found that I can use the following switch in my shortcut to SQLDeveloper to achive this.
    C:\oracle\sqldeveloper\sqldeveloper.exe -J-Dide.user.dir="%USERPROFILE%\.SQLdeveloper"
    I tried to modify the SQLDeveloper.boot but that did not seem to work correctly. The above mentioned switch updates the "c:\documents and settings\%username%\.sqrdeveloper" with all password related information and SQL history that was important to meet our security requirements. We updated the shortcut in the AllUsers profile and this seems to work globally.
    The only bad thing about this approach is that anyone can go into %AppData%\sqldeveloper.exe and run it without using the shortcuts. This would bypass the security precaution.
    Is there a better way to approach this?
    Regards,
    Tom

  • ORA-12518  Failed to handle connections

    Please,
    I have this error more often for a couple of days, and I'm wondering if there is not a deep reasons causing that?.
    This error disappear itself wihtout any error or some times we restart the listener and it goes.
    I'm working on 10g, windows 2003
    Thanks

    You should turn on tracing for the listener to get more accurate informations. Sometimes connections are not properly closed. ORA-12518 basically means the listener is unable to serve further connection requests. When it is a shared server architecture, dispatchers could be overloaded.
    Werner

  • OSMF handling connections on Flash Media Server

    How do I "kill" a connection on Flash Media server using OSMF?
    Can I just "stop" a video (i.e. _player.stop() ) or do I have to set the media to null?

    MediaPlayer.stop() will only stop playback of the stream, but not close the connection.
    If you set MediaPlayer.media to null, then it will close the connection.

  • Is connecing thru a datasource slower then handling connections thru code?

    We have an application that connects to a database using the latest Oracle 10g thin drivers. When a connection is made the response from the database takes anywhere from 15 - 25 seconds. When we make a connection thru the code base using the same connect string it takes less then 1 second. Is this normal?
    We see that the response comes back in 30 packet chunks over the network regardless of the size of the query, it just show up more the larger the query is. Is this 30 byte chunk set a WebLogic limitation? Can it be bypassed?

    Is yours an external application, either making direct JDBC connections to the DBMS or using a WebLogic server and a WebLogic DataSource?
    If so, then the result is expected. Going from application to weblogic and then to the DBMS is expected to be slower than going directly from application to DBMS.

  • Too many connections - even after closing ResultSets and PreparedStatements

    I'm getting a "Too many connections" error with MySQL when I run my Java program.
    2007-08-06 15:07:26,650 main/CLIRuntime [FATAL]: Too many connections
    com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Too many connections
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812)
            at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269)
            at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)I researched on this and found out that I wasn't closing the ResultSet and the PreparedStatement.
    The JDBC connection is closed by a central program that handles connections (custom connection pooling).
    I added the code to close all ResultSets and PreparedStatements, and re-started MySQL as per the instructions here
    but still get "Too many connections" error.
    A few other things come to mind, as to what I may be doing wrong, so I have a few questions:
    1) A few PreparedStatements are created in one method, and they are used in a 2nd method and closed in the 2nd method
    does this cause "Too many connections" error?
    2) I have 2 different ResultSets, in nested while loops where the outer loop iterates over the first ResultSet and
    the inner loop iterates over the second ResultSet.
    I have a try-finally block that wraps the inner while loop, and I'm closing the second ResultSet and PreparedStement
    in the inner while loop.
    I also have a try-finally block that wraps the outer while loop, and I'm closing the first ResulSet and PreparedStatement
    in the outer while loop as soon as the inner while loop completes.
    So, in the above case the outer while loop's ResultSet and PreparedStatements remain open until the inner while loop completes.
    Does the above cause "Too many connections" error?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The following is relevant sections of my code ( it is partially pseudo-code ) that shows the above 2 cases:
    init( Connection jdbcConnection ){
       String firstSQLStatement = "....";
       PreparedStatement ps1 = jdbcConnection.prepareStatement( firstSQLStatement );
       String secondSQLStatement = "....";
       PreparedStatement ps2 = jdbcConnection.prepareStatement( secondSQLStatement );
       String thirdSQLStatement = "....";
       PreparedStatement ps3 = null;
       ResultSet rsA = null;
       try{
            ps3 = jdbcConnection.prepareStatement( thirdSQLStatement );
            rsA = ps3.executeQuery();
            if( rsA.next() ){
                   rsA.getString( 1 );
       }finally{
            if( rsA != null )
                   rsA.close();
            if( ps3 != null )
              ps3.close();
       //Notice, how ps1 and ps2 are created here but not used immediately, but only ps3 is
       //used immediately.
       //ps1 and ps2 are used in another method.
    run( Connection jdbcConnection ){
         ResultSet rs1 = ps1.executeQuery();
            try{
               while(rs1.next()){
                    String s = rs1.getString();
                    ps2.setString(1, s);
              ResultSet rs2 = ps2.executeQuery();
                    try{
                   while(rs2.next()){
                        String s2 = rs2.getString();
                    }finally{
                   if( rs2 != null )
                     rs2.close();
                   if( ps2 != null )
                     ps2.close();
         }catch( Exception e ){
              e.printStackTrace();
         }finally{
            if( rs1 != null )
                  rs1.close();
               if( ps1 != null )
                  ps1.close();
    //Notice in the above case rs1 and ps1 are closed only after the inner
    //while loop completes.
    }I appreciate any help.

    Thanks for your reply.
    I will look at the central connection pooling mechanism ( which was written by someone else) , but that is being used by many other Java programs others have written.
    They are not getting this error.
    An addendum to my previous note, I followed the instructions here.
    http://dev.mysql.com/doc/refman/5.0/en/too-many-connections.html
    There's probably something else in my code that is not closing the connection.
    But I just wanted to rule out the fact that opening a PreparedStatement in one method and closing it in another is not a problem.
    Or, if nested ResultSet loops don't cause the problem.
    I've read in a few threads taht "Too many connections" can occur for unclosed RS and PS , and not just JDBC connections.

  • Acrobat/Reader cannot cope with internal Webserver connectivity problems, leading to comments being hidden/deleted. Any thoughts?

    Adobe Acrobat/Reader do not cope with interruptions to access to the internal WebServer hosting the PDF/XML review files.
    Steps to reproduce the issue:
    Connection is lost to the WebServer hosting the PDF review files.
    After connection to the WebServer is regained, access to the PDF review files is blocked by Adobe Acrobat/Reader.
    Sometimes this can be resolved by deleting the entire contents of the folder:
              C:\Users\<user-name>\AppData\LocalLow\Adobe\Acrobat\11.0\Synchronizer
    NOTES:
    We have experienced this behaviour especially when connecting to the WebServer via VPN. I reckon the connectivity issues could be initially our problem, that Acrobat/Reader simply do not handle.
    Clearing the contents of the Synchronizer folder does not always work.
    Team members have also seen situations where significant numbers of review comments or status values have been not been displayed, but exist in the XML review files. In some cases comments/status values have been automatically deleted without warning from the Adobe review XML files.
    PDF reviews are sent out via email as links to the PDF review file hosted on an internal WebServer.
    Writers and reviewers in the team either have either:
    Acrobat XI Pro 11.0.08 with Reader 11.0.08
    Acrobat XI Pro 9.5.5 with Reader 11.0.08
    I have personally experienced the above behaviour with Acrobat XI Pro 11.0.08 and Reader 11.0.08.
    Could this experience be connected the Synchronizer (http://helpx.adobe.com/acrobat/kb/known-issues-acrobat-xi-reader.html )?
    For example, where a reviewer uses a different version of Acrobat/Reader?
    Could anyone please provide a list of compatible versions of Acrobat/Reader?
    Expected results:
    Adobe Acrobat/Reader should really handle connection issues with a warning and later check for recovered connections.
    However, what appears to be happening is that Acrobat/Reader writes some sort of blocking code to the Synchronizer folder that prevents future checks of the PDF review files on the review WebServer.
    As far as I understand, the connection issues are not caused by Adobe software, however the problems we are experiencing relate to how Adobe Acrobat/Reader handle this loss of connection.
    Plea for Help!
    I have checked and the experience of missing comments and persistent "connectivity issues" seems to be a reported but sadly outstanding issue...
    This has been an ongoing headache for some time, so solutions would be great, but any thoughts or suggestions are welcome...?
         For example, has anyone using SharePoint to host PDF reviews experienced anything similar?
    Many thanks!

    Adobe Acrobat 11.0.09 with Microsoft SharePoint Repository Trial Update
    We've completed week one of a three week trial (see above) that will go on until Friday 24th October.
    We currently have just four PDF files out for review that make use of the SharePoint repository.
    To-date:
    Each review file has had multiple concurrent reviewers posting comments over several days from both over the office LAN and also via VPN when working remotely.
    Dynamic stamps seem to be working as hoped and are all visible.
    We have not experienced any connection-type issues and the we have not had reason to clear out the Synchronizer folder as described above.
    Counter balance:
    I have experienced the situation with a remote VPN connection, where Adobe Acrobat could not connect to our internal WebServer repository. At the same time, I was able to connect to PDF review files hosted in SharePoint.
    Summary:
    The experience so far does suggest that problems are caused by the an inconsistent connection to the WebServer repository (especially over VPN) combined with Adobe Acrobat/Reader's inability to cope with the resulting situation.
    At the moment I must say that while it is early days, I am hopeful that the combination of SharePoint as the repository and the update to Adobe Acrobat/Reader 11.0.09 will continue to prove to be reliable.
    I'll provide an update to this post on Friday 24th October...
    Here's hoping!

  • Urgent...Help Needed.1. Helper Class 2. Connection Pool

    Hello,
    1. There are few helper classes which has to be
    shared b/w session and entity beans. But it
    seems,state of the object is not transfered to entity
    bean though the class has implemented Serializable
    interface. I have archived all the helper class and
    copied to j2ee\home\lib directory. The same jar file
    is made accessible to server via updating <library-
    path> in j2ee/home/config/application.xml file.
    2. How can i utilise connection pooling in oc4j. In data-sources.xml, i am using
    "OracleConnectionPoolDataSource" class. But i feel that connection pool is not utilised coz server hangs in the middle of the retrieval.
    The value of max-connections is 50.
    We are actually migrating from Weblogic 5.1.0 to Oracle 9i AS. In weblogic, we had given 10 max connections in weblogic.properties,it is working fine. But i dont understand why it is not working in 9i AS though the max-connections is 50.
    Kindly let me know the solution at the earliest as it is very urgent to get the program running...
    Thanx and Regards,
    Achyuth

    Hi,
    hopefully I can help you.
    1. There are few helper classes which has to be ...We have just the same constellation. We have put the HelperClasses in the
    J2EE/home/lib dir, NOT specifying it in the application.xml. So everything works fine.
    The only thing: never, again: never put these files within WEB-INF and the lib-dir.
    With the HelperClasses in both we have only faced massive problems, mostly ClasCastExceptions.
    We had once all the helperClasses within J2EE/home/applications/lib, but this requires to
    specify this dir within the orion-application.xml within the appl dir in applications-deployment.
    It also worked fine.
    2. How can i utilise connection pooling in oc4j. In data-sources.xml, i am using ...I'm not sure of this, but I think, the container handles Connection Pooling, no matter what Factory you
    specify. But I think, the Class hasn't to be OracleConnectionPool ... but I have to check this (right now
    I have no access to our datasource.xml ..)
    cu
    ed

  • Problem in using XSQL-session and connecting database

    Hello
    Let me explain clearly. We have some data entry screens for which we want to use session with time out option. Normally in Servlet, we use to create a session with max age option. Then everytime the browser call the servlet we use to check for session.isnew(). If it is new session then we will forward the page to Relogin (because session is timed out) or we proced with further action.
    In XSQLServlet, how will do this. Do I have to create my own servlet extended from XSQLServlet ? Override the Service method and write about the session part and call
    super(). Here only I am getting confused. In servlet mapping we have given for every .XSQL call run the XSQLServlet. How will I override this ?
    And also we have problem with user id and password. We don't want to use the same id (system id as defined in XSQLConfig.xml) for every database connection. We want to define only the connection information like SID, Server, Port number. But user id and password should be dynamic. How can I achieve this ?
    Please help us on solving these problem. Thanks.
    Lakshmi
    null

    You'll need to implement your own classes that implement the:
    oracle.xml.xsql.XSQLConnectionManagerFactory
    and
    oracle.xml.xsql.XSQLConnectionManager
    to change the way XSQL handles connections. Using this mechanism, you should be able to implement any alternative connection scheme you choose.
    If you run into problems implementing these interfaces, give us a shout here in the forum.

  • Handle errors when makeing doc.submitForm()

    Hello,
    I am trying to submit PDF form by method doc.submitForm, example:
    doc.submitForm
            cURL: "http://localhost/reader_test.php?name=" + name.rawValue,
            cSubmitAs: "XML"
    A) With this approach, is it possible to handle connection errors and display custom error message (and cancel the original one) ?
    I have tried something like
    try{  doc.submitForm(...); } catch(e) { //handle code }
    but it seems to be run asynchronously.
    B) Is it possible to add custom HTTP headers to the POST ?
    I saw that FormCalc can do it in Post() funciton, but when using Post() function, the Reader displays Yello-bar security dialog, that made our previous SOAP-based solution too complicated for the end user.
    Appreciate any help.
    Radek

    Sofar I have not found the way how to handle errors when using doc.submitForms(), but there may be following workaround (mey be?):
    The server returns as a response to a submitForms() call a pdf content, which is displayed as a document in a new Reader's window. Is it possible to place some javascript into this new window, that would refer to parent window and send to it some message ? Or at least to detect at the "parent" window, that a "child" window was opened ?
    So is there any relation between the newly opened document with the response from server and the original document, that initiated calling of doc.submitForms()?
    Thanks.

Maybe you are looking for

  • External hard drive not mounting

    external hard drive not mounting

  • How to create recovery disk for windows 8.1 after update from windows 8.

    My laptop came with windows 8 and i have recovery discs for windows 8. Now i've updated to windows 8.1, so i want to creat recovery discs for windows 8.1.  So in future when i use recovery discs i dont have to download windows 8.1 again. Please tell

  • How to handle same product with different part numbers and pricing in SAP.

    I am a new user and want to learn if the following scenario can be handled by SAP. Our business buys a product from a supplier which has 2 different part numbers and prices. It is the same product. One is the primary product whilst the other is avail

  • Siebel 7.8 iHelp

    Hi Could you please help me on a issue of Configuring iHelp in 7.8. Currently i am facing issue in Associating Screen for an iHelp. When i click New in Screen subtab of iHelp Administration, the applet is blank. I have mapped the required application

  • Solaris 64-bit Top Available

    Hi Everyone, I've noticed that, much like on SPARC, you seem to need a 64-bit top if you want to see the correct memory statistics for 64-bit processes under Solaris 10 for AMD64. That said, I've built a 64-bit top package for everyone using Solaris