JDBC Usage - Managing Connections

Hi:
I'm not a Java Guru, I'm a rookie... so here it goes:
For developing my JSP apps to generate XML to my wireless apps I use this kind of instructions:
Class.forName("oracle.jdbc.driver.OracleDriver");
String url_qry = "jdbc:oracle:thin:@193.136.231.151:1521:neo";
String query_qry = "";
query_qry = "select * from clientes where cod_cliente = 1"
Connection conn_qry = DriverManager.getConnection(url_qry, p_username, p_password);
Statement stmt_qry = conn_qry.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rset_qry = stmt_qry.executeQuery(query_qry);
rset_qry.absolute( 1 );
%>
.... my xml or html
<%
     rset_qry.close();
     stmt_qry.close();
     conn_qry.close();
%>
My question is... Why my OC4J container shows always a high number of connections and the number of connections never shrink? I'm the only user to use these apps. So, Even if I use the close() methods the JDBC Usage in OC4J shows always growing numbers and never shrink...
Thanks

Hi Joao,
This is only a guess, but OC4J uses a database connection pool, so this is probably why you are seeing a large number of connections.
You can configure the size of the OC4J connection pool.
Have you read the OC4J documentation, or tried asking this question in the OC4J forum, or looked at the code samples from the "Technet" Web site?
http://technet.oracle.com/tech/java/oc4j/content.html
Hope this helps you.
Good Luck,
Avi.

Similar Messages

  • JDBC-ODBC-Bridge connection to SQL Database

    Hi guys
    I have a problem. I've made a little game which I want to put on my website. It has a highscore-list which I want to connect to my web host's database server to get the current list.
    I tried this with JDBC and got it to work locally but when I uploaded it to my site it didn't work. I contacted my web host's technical support who told me that their server didn't have the JDBC driver and that I should use ODBC instead. I did lots of reading and found out about this JDBC-ODBC-Bridge. I have since been trying to implement this into my program but hasn't been successful.
    In my original JDBC connection I used
    private String url = "jdbc:mysql://" + host +  "/" + mydatabase;
    Class.forName("com.mysql.jdbc.Driver");
    Connection connection = DriverManager.getConnection(url, username, password);Now I'm trying
    private String url = "jdbc:odbc://" + host + "/" + database;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection = DriverManager.getConnection(url, username, password);But, at least when trying it locally, I get the error
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name is too long.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at HighscoreDB.readFile(HighscoreDB.java:53)
    at HighscoreDB.displayList(HighscoreDB.java:97)
    at HighscoreDB.main(HighscoreDB.java:33)Please help ;)
    Edited by: YZF-R1 on 2009-apr-09 13:26

    YZF-R1 wrote:
    masijade. wrote:
    Do you know what ODBC is?I think I at least have the basic idea, I learnt most of what I know from this post:
    [http://forums.sun.com/thread.jspa?threadID=211735&start=2&forumID=48]
    masijade. wrote:
    While "reading about this JDBC-ODBC Driver" did you also read about how to enter the URLs for it?No, I couldn't find that piece of information, why don't you tell me ;)
    Here
    >
    masijade. wrote:
    Did also read about the fact about needing to configure ODBC DSNs? Or about the fact that the connection URL is radically different if you don't configure one?No I did not. Please explain =)
    Here
    >
    PhHein wrote:
    Plus, JDBC-ODBC Bridges are evil!I'm beginning to realize this myself :O:(
    BalusC wrote:
    Drop that whole ODBC idea and just gently read the documentation which come along with the MySQL JDBC driver.I read a lot of it when I used the JDBC driver locally but how's that going to help me if the server doesn't have the JDBC driver installed?How will the Bridge help you if the ODBC Driver is not installed? And, the JDBC Driver (the Type 4.0 ones, which the MySQL Driver is) is 100% Java, so it can even be included in an Applet, if the HTML page that accesses it is done right, and the jars are "packaged" properly.

  • Newbie question : managing connections in a 3-tier application

    Hi all,
    In an application running on WLS6.0, consisting of jsp/servlets as
    client, ejb middle-tier and an oracle db, how are the connections
    supposed to be managed? If the browser client is killed, how do we
    ensure that the connection that it was holding onto is freed up?
    What sort of an impact would the transaction framework have on this?
    For instance, if transaction mgmt is being done client-side (using
    UserTransaction). Please let me know if there is any good reading
    material on this subject.
    Thanks,
    Vaishali

    Thanks Joe, it does make sense.
    No, I was not talking about simple data which Vector could hold, but large amounts
    of rows returned from search. Somehow I thought ResultSet could be kept around
    for "paging" as it might use connection pooling, I guess not ...
    thanks,
    Stefan
    Joseph Weinstein <[email protected]> wrote:
    Hi. Once you close either the connection or the statement, the result
    set is
    finished. ResultSets are not useable as data caches. Consider them as
    thin Java wrappers around the socket to the DBMS while it is in the
    process of sending back data. Your code will need to completely absorb
    all
    result set data within the JDBC-aware method, and then close all the
    JDBC objects. Look into Sun's implementation of RowSets, or our DbKona
    classes. These are objects designed to hold result set contents, and
    allow
    you to send them or save them, and to randomly access the contents. If
    your data is simple, a simple Vector may do for you.
    JDBC objects should never be held across transactions. With connection
    pooling available, not even connections should be held.
    Joe
    Stefan wrote:
    Hi Slava,
    I need a clarification in your scenario, if you don't mind ...
    If 4. closes the connection, ResultSet returned at 3. will no longerfunction
    right? Is the rule to close result set after each client request orit can be
    used "accross" transactions? As a pattern it makes a big difference,but I'm not
    able to find the correct way to do this. Similar with Stateful EJB,it could hold
    on a result set between client requests or if not it needs to cachethe results?
    thanks,
    Stefan
    "Slava Imeshev" <[email protected]> wrote:
    Hi Vaishali,
    Normally you should not hold connections for long. The standard pattern
    for using JDBC directly from web tier is 1. Grab a connection 2. Execute
    request. 3. Return result 4. Close opened JDBC objects including connection.
    If you do reserve connection on per-session basis, you need to make
    sure that you close JDBC objects when client's session is timed out.
    But generally it's a bad practice and you'll hardly use it.
    Killing client's browser does not affect connections.
    Transaction framework allows to have consistent data, which is good.
    If you use user transactions, and for some reason client dies without
    commit or rollback, generally transaction will be timed out and rolled
    back.
    There is a couple of useful books. You may look at Ed Roman's
    Mastering EJB 2nd edition, which is IMHO the best one, plus
    there is a book J2EE design patters from Sun. There are some
    good ideas in it but it's surprisingly hard to read.
    Regards,
    Slava Imeshev
    "Vaishali Nayak" <[email protected]> wrote in message
    news:[email protected]...
    Hi all,
    In an application running on WLS6.0, consisting of jsp/servlets
    as
    client, ejb middle-tier and an oracle db, how are the connections
    supposed to be managed? If the browser client is killed, how dowe
    ensure that the connection that it was holding onto is freed up?
    What sort of an impact would the transaction framework have on this?
    For instance, if transaction mgmt is being done client-side (using
    UserTransaction). Please let me know if there is any good reading
    material on this subject.
    Thanks,
    Vaishali

  • Diagnostics Profiling JDBC usage and leak problem

    Hi:
    Currently, I running diagnostics profiling JDBC usage and leak on my four Managed servers. It is collecting data for few hours, then it stop collecting data. Do anyone know why? How can I get it back to collecting data? Thank You

    Hello,
    Sorry you're having trouble...could you provide a bit more information as to your configuration, and how you are enabling JDBC profiling?
    Specifically:
    - What version of the server are you using?
    - Are you using the JDBC profiling hooks, or do you mean that you are using WLDF JDBC Instrumentation Monitors?
    - Are you saying that you're experiencing leaks because of this issue, or that you are using the profiling functionality to debug a potential leak?
    If you have WLDF configured, can you post your WLDF System Resource descriptor? It's located in <domain-dir>/config/diagnostics.
    Thanks,
    Mike

  • Problem with a JDBC Adapter when connect to Instance on SQL Server

    Hi,
    Currently I'm setting up a communication channel with the JDBC adapter to work on a SQL Server database. When I use a string without specifying the connection instance, the JDBC driver takes the default instance and connects to a database without problems.
    jdbc: sqlserver: / / Server01; databaseName = IntegraSAP1
    The problem is when I need to connect to another instance of it server.
    jdbc: sqlserver: / / Server01; instanceName = SAP; databaseName = IntegraSAP2
    The JDBC driver, in short, send me the following error:
    Cause Exception: 'Error when attempting
    to get processing resources: com.sap.aii.af.lib.util.concurrent.ResourcePoolException:
    Unable to create new pooled resource: DriverManagerException:
    Can not establish connection:: com.microsoft.sqlserver.jdbc.SQLServerException:
    The connection to the named instance  has failed. Error:
    java.net.UnknownHostException: .
    I appreciate your help,
    Regards,
    Johnny

    Not sure, might be port number is not required in case using instance. Give one more try with :
    jdbc:sqlserver:/ /Server01\SAP; databaseName = IntegraSAP2
    A comment from http://msdn.microsoft.com/en-us/library/ms378428.aspx
    "SQL Server 2000 and SQL Server 2005 allow for the installation of multiple database instances per server. Each instance is identified by a specific name. To connect to a named instance of SQL Server, you can either specify the port number of the named instance (preferred), or you can specify the instance name as a JDBC URL property or a datasource property."
    Regards,
    Sunil Chandra

  • Manage Connections No green checkmark next to wifi??????

    I just got my 8900 and am trying to connect it to my wifi at home.  I have set up the wifi network, scanned and input my WEP key.  My 8900 says it was successful and i get the light gray wifi and the name of the network but the wifi(on the home screen) never gets brighter and I never get the green checkmark on the manage connections page(only a white dash).  Can any one help?  I have been reading threads for the past two days and have not found a reference to this.  I do not have a data plan and I am on At&t. 
    On a related note how would I know if I am using At&t's pay network for the internet or if my 8900 is using wifi?
    Any help or links would be greatly appreciated.  
    Thanks,
    Micki

    1) Is it possible your WiFi router is blocking your access?  You can be connected to your WiFi router, but not to the Internet!
    2) Are you manually assigning your BB an IP Address, or letting your router assign it automatically?
    a.  If you're letting your router assign your BB an IP Address automatically, is your router correctly set up to do that?
    b.  If you're assigning your BB an IP Address manually, did you specify the default IP Address (usually 192.168.1.x where "x" is a number 1-255 which doesn't match any other device on your network), DNS Server, and Gateway (the latter two are usually identical, 192.168.1.1)?
    If using a dynamically assigned IP Address, try setting it manually on both the BB and the router.
    I always assign all the computers on my home network their own IP addresses.  It helps cure all kinds of problems!

  • JDBC fails to connect to 8.1.7.0.1 on Linux

    Hi,
    I compile and run the sample JDBCVersion program on a Win98 client PC. It works ok connecting to a Sparc 8.1.7.0.1. However, when it connects to 8.1.7.0.1 on Redhat 7.3, it gives the following error.
    D:\Programs>java JDBCVersion
    Exception in thread "main" java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:266)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at JDBCVersion.main(jdbcversion.java:10)
    The strange thing is if the same program is run on the local Redhat 7.3 machine, it works fine!
    I checked the listener.log file. The log message for the successful and unsuccessful cases are the same (of course except the HOST= field).
    Is it a bug?
    Regards,
    John Lee

    Hi Rahul,
    Thanks for your response. I'm using Oracle Java Thin client. Environment is J2SE SDK 1.4.1_01 (uses classes12.zip from Oracle).
    Successful cases
    - Win98 can use ODBC and SQL*PLUS to connect to the remote Oracle8i
    - Win98 can use JDBCVersion program to connect to a remote Oracle8i on Sparc and another Oracle9i on RedHat 7.3
    - JDBCVersion can successfully connects to Oracle8i on Redhat 7.3 if it is run locally on the database server
    Failed cases
    - When JDBCVersion runs on Win98, it fails to connect to remote Oracle8i on Redhat 7.3
    The log from listener.log shows that nothing special happens when JDBCVersion runs on Win98 to connect.
    Any clues?
    Regards,
    John

  • NullPointerException from oracle.jdbc.driver.OracleDriver.connect()

    I ran into an NPE when using Oracle thin client 11.1.0.6.0 (ojdbc6.jar) to connect to a 10g server. It is not easy to reproduce though. The following is the stack trace, any suggestions?
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:334)
    at java.util.Properties.getProperty(Properties.java:932)
    at oracle.jdbc.driver.PhysicalConnection.parseConnectionProperty_String(PhysicalConnection.java:2037)
    at oracle.jdbc.driver.PhysicalConnection.parseConnectionProperty_int(PhysicalConnection.java:2072)
    at oracle.jdbc.driver.PhysicalConnection.readOCIConnectionPoolProperties(PhysicalConnection.java:1936)
    at oracle.jdbc.driver.PhysicalConnection.readConnectionProperties(PhysicalConnection.java:1927)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:471)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:382)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:458)
    at com.verisign.uaservice.dbverify.dao.DBVerifyDAOImpl.getRecordAsPair(DBVerifyDAOImpl.java:255)
    at com.verisign.uaservice.dbverify.Verifier.verify(Verifier.java:37)
    at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

    What is the exact 10g version?
    According to MOS note 207303.1, for connection between 11g client and 10g server, there is a minimum version requirement on 10g server side.

  • NullPointerException at oracle.jdbc.driver.OracleDriver.connect()

    I have written a java stored procedure. The method can be executed properly in local PC environment.
    but when the java program is load into Oracle DB JVM by loadjava command. such method is called in SQL> prompt as a java stored procedure. I got
    java.lang.NullPointerException
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:379)
    at java.sql.DriverManager.getConnection(DriverManager.java:573)
    at java.sql.DriverManager.getConnection(DriverManager.java:187)
    at WCZSynchronizer.testLocalConn(WCZSynchronizer:901)
    as shown in the trace file.
    The line in my own java program WCZSynchronizer is simply
    Connection conn = java.sql.DriverManager.getConnection(db_connection_string,username,password);
    I am sure that the db_connection_string, username and password are correct as it works in my local PC.
    I even try to get default connection by
    Connection conn = java.sql.DriverManager.getConnection("jdbc:default:connection:");
    and
    Connection conn = new oracle.jdbc.driver.OracleDriver().defaultConnection();
    I got the same NullPointerException in both cases too.
    In fact, the java stored procedure worked before. but suddenly it's failed! The Oracle DB server is under my control and I did not change any configuration nor setting on it.
    I can't find similar case from this forum. Do any one know why?
    thanks.

    First try debugging the test case by making sure that none of the parameters passed to getConnection is null.
    When you are sure that none of the parameters are null, if the issue still reproduces. Let us know
    - The driver version
    - The jar file you are using
    cheers
    Ashok

  • Where can I get a db2 jdbc driver with connection pool

    hi,all
    I want to look for a free jdbc driver to connect to db2 using with connection pool.
    it isn't present in db2java.zip
    thanks and regards
    [email protected]

    To find JDBC drivers take a look at SUN's overview at http://industry.java.sun.com/products/jdbc/drivers

  • Cannot acquire a managed connection

    Dear All,
    I am very new to the SSIS package development so please point out my stupidity If I have done any. I am trying to ETL data from excel spreadsheet to SQL server using Excel data connections and OLE DB and ADO.Net data connection. I am using CDC task to monitor
    any changes done in the source excel file. I am doing it in a way same package extract information from the spreadsheet and import in to Server 1 (CDC enabled) and compared it to the same table hosted on another server 2 which is a production server.
    When I run this package on DTS it runs fine and I am able to generate Deployment Manifest file. When I try to run the same Manifest file I am getting below error
    Error: Failed to Decrypt an encrypt XML node because the password was not specified or not correct. Package load will attempt to continue without the encrypted information.
    Error: Cannot acquire a managed Connection from the run-time connection Manager
    I have change the package encryption level from "EncryptSensitivewithUserkey" to "EncryptsensitivewithPassword" and have added password to the PackagePassword it the package property and saved this project.
    when i add this package to the SQL agent job I am still getting below error message
    Message
    Executed as user: administrator. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  11:44:49  Error: 2014-12-04 11:44:52.10
        Code: 0xC020801F     Source: CDC Control Task CDC Control Task     Description: Cannot acquire a managed connection from the run-time connection manager.  End Error  Error: 2014-12-04 11:44:52.10     Code:
    0xC0024107     Source: CDC Control Task      Description: There were errors during task validation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  11:44:49  Finished: 11:44:52
     Elapsed:  2.215 seconds.  The package execution failed.  The step failed.
    Please help I am stuck on this issue from last 2 days now. If you need more info please let me know.
    regards
    JK

    Looks like you run the package in thee Agent for this purpose you should use the 'Rely on server storage for encryption' (ServerStorage) protection
    In the "EncryptsensitivewithPassword" scenario you need to provide the actual password by editing the command line in there:
    with adding switch /De <password> to it
    Arthur
    MyBlog
    Twitter

  • Could not create a managed connection manager ; SSIS package from SSMS - Windows 7 64 bit

    I created connection as Oracle provider for .Net.
    In data flow, using the ado net source. select data access mode as SQL command.
    When click preview. data is coming.
    But when right click the dataflow task --> execute task.
    data flow is failed with following error
    [ADO NET Source [1]] Error: Microsoft.SqlServer.Dts.Runtime.DtsCouldNotCreateManagedConnectionException: Could not create a managed connection manager. at Microsoft.SqlServer.Dts.Runtime.ManagedHelper.GetManagedConnection(String assemblyQualifiedName, String
    connStr, Object transaction) at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager100.AcquireConnection(Object pTransaction) at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.AcquireConnections(Object transaction) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper100
    wrapper, Object transaction)

    Do you run it under 64bit?
    if yes, go to Project menu, select project properties.
    in the project properties window, go to Debugging tab, and set Run64BitRuntime as false. and try again.
    http://www.rad.pasfu.com

  • Installing JDBC driver to connect to Oracle 8i Database from Weblogic 10.3

    I want to connect to Oracle 8i database from weblogic 10.3 application server. I found a classes12. zip file on Oracle.com to use as driver for the same.
    I am also connecting Oracle 9i database from the app server. Now if i replace the classes12. jar from the lib folder won't it disallow me to connect to the Oracle 9i database.
    2ndly the claases12.zip file i found from the site is for jdk 1.2 will it create any problems. Please let me know
    Kindly let me know what is the standard procedure to install a new driver in Weblogic 10.3.

    I tried to install weblogic 10.3 using jdk 1.5.07 but. it is not supported. Moreover from the sites also i found that it's only the application wars and ears compiled in jdk 1.5 need not be recompiled in 1.6. But no reference of jdk 1.5 is there.
    I tried to use thin client from the code and connect to Oracle 7i
    i got the following exception.
    java.lang.ArrayIndexOutOfBoundsException: 4
    at oracle.jdbc.driver.T4C8TTIdty.marshal(T4C8TTIdty.java:465)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:329)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    490)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio
    n.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at com.omantel.finacc.DAO.DatabaseConnection.getUBCCConnection(DatabaseC
    onnection.java:372)
    at com.omantel.finacc.java.DMADAO.getUBCLAmount(DMADAO.java:411)
    at jsp_servlet.__receiptentry._jspService(__receiptentry.java:1198)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:292)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3498)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:2180)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:2086)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1406)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    <Apr 22, 2009 3:36:47 PM GMT+04:00> <Error> <HTTP> <BEA-101017> <[weblogic.servl
    et.internal.WebAppServletContext@553afb - appName: 'DMA', name: '/DMA', context-
    path: '/DMA', spec-version: 'null'] Root cause of ServletException.
    com.omantel.finacc.exception.AppException: 4
    at com.omantel.finacc.exception.ExceptionHandler.handleException(Excepti
    onHandler.java:43)
    at com.omantel.finacc.java.DMADAO.getUBCLAmount(DMADAO.java:428)
    at jsp_servlet.__receiptentry._jspService(__receiptentry.java:1198)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:292)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3498)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:2180)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:2086)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1406)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    java.lang.ArrayIndexOutOfBoundsException: 4
    at oracle.jdbc.driver.T4C8TTIdty.marshal(T4C8TTIdty.java:465)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:329)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    490)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio
    n.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at com.omantel.finacc.DAO.DatabaseConnection.getUBCCConnection(DatabaseC
    onnection.java:372)
    at com.omantel.finacc.java.DMADAO.getUBCLAmount(DMADAO.java:411)
    at jsp_servlet.__receiptentry._jspService(__receiptentry.java:1198)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:292)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3498)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:2180)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:2086)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1406)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    >

  • JDBC ODBC bridge connections using 2.1.1

    Hi,
    I have reviewed a lot of postings related to JDBC and third party drivers and understand how to connect to the packaged drivers such as MySQL and MS SQL Server/Sybase. Where I'm stuck is the reference in the Connections help to JDBC. We have a ODBC system DSN that's not part of the existing JDBC drivers. The help implies it's possible to create a JDBC:ODBC bridge connection and that JDBC:ODBC bridge functionality is part of the JDK therefore should not require additional jar files. However, the JDBC tab is not an available connection type by default. I traced the JDBC ODBC bridge to the rt.jar and tried adding that to the third party extensions but that has not resulted in the JDBC tab becoming available.
    Is the JDBC tab only available when using commercial JDBC ODBC bridge drivers ?
    For all other connections (DB2, TimesTen, Teradata etc) the help is very specific about which jar files you need and any other requirements but the JDBC section it is unclear how you enable JDBC connectivity.
    Thanks
    Steven
    Edited by: slisint on 14-Jan-2011 18:07

    We are using the JDBC-ODBC bridge to do a prepared
    statement. I have seen other bugs that suggest this
    is problematic with older version of JRE, but was
    supposedly fixed in later versions.
    java.sql.SQLException: General errorIf it is not too late, check the following link:
    http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/GettingStartedTOC.fm.html
    Sections 6.1.3 and 8 (especially tables at the end).
    I had the same case, and the problem was that the field in the Oracle database was defined as NUMBER(4), witch is equivalent to INTEGER in JDBC types, and function setInt should be used with INTEGER, instead of setLong.
    This is explained in sections I mentioned.

  • Managing Connections in a desktop Application or Applet

    Wondering how people usually manage connections in a fairly large GUI application (or Applet).
    I'm used to using a Connection Pool with Servlets.
    Is this worth using with an Application or is it ok to create a Connection at startup and use it throughout the whole execution?
    Is it ok then to pass references to this Connection to other classes in the application?
    Any tips, experiences, guidelines would be appreciated.
    Thanks.
    Derek

    Hi
    I'm assuming that you are using a J2EE Application Server that implements datasource pooling if you have the ability to use Pooled Connection with your servlet (if not, then you must have created your own connection pool?).
    Basically, if you have an Applet, then there is no reason to change your current way of working...simply let a servlet in your container handle the database stuff, then return the results to the Applet.
    For desktop standalone applications, things are a bit different. You will probably have to implement your own pool. Best practices...hmm...not an expert but I would have thought it best to open the connection, do the SQL stuff, then close it straight away, and in doing so release the connection back to the pool for another application to use (assuming you have a pool). If you are thinking about opening a connection for every application and holding these indefinitely, then you will eventually run into trouble. How many connections can your database handle???
    Hope that helps

Maybe you are looking for