Using Spring JDBC with JHeadstart

We have to migrate a Forms application using JHeadstart.
But all of the business logic is present in a set of PL/SQL
code which is required to be reused for the J2EE based forms.
Therefore, the JHeadstart migrated application needs
to use the PL/SQL code to display and update data.
If Spring JDBC has been chosen as the DAO technology
to create the DTOs, how can we plug this into the JSF
pages created by JHeadstart?
Thanks,
Gurdev

Gurdev,
JHeadstart only works on top of ADF Business Components. So if Spring is a given, you cannot use JHeadstart.
Note that ADF BC provides excellent support to call stored procedures, very similar to how Forms supports blocks based on stored procedures, so if it is still an option you might want to consider using ADF BC instead of Spring, which would open the door for JHeadstart as well.
While Spring is a great framework (we use it under the covers in JHeadstart as well!), I believe ADF BC is the best fit when migrating forms, since many Forms concepts have been brought forward to ADF BC. For example, check out this link:
http://www.oracle.com/technology/products/jdev/tips/muench/formstriggers/index.html
Steven Davelaar,
Jheadstart Team.

Similar Messages

  • Problem in using JDeveloper 10g with JHeadstart

    I am using JDeveloper 9.0.3 and jheadstart 9.0.4.5 and I would like to test jdeveloper 10g preview with JHeadstart.
    So, I have downloaded the JDeveloper 10g to test it with my old application.
    Having run the Jdeveloper for the first time, I realized that Jdeveloper
    installed the jheadstart automatically and following message was shown in the message window :
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\PrjWizard.jar!\META-INF\jdev-ext.xml
    Error: <Line 12, Column 24>: XSD-2034: (Error) Element 'description' not expected.
    Error: <Line 13, Column 17>: XSD-2034: (Error) Element 'help' not expected.
    Error: <Line 17, Column 27>: XSD-2034: (Error) Element 'dependency_addin' not expected.
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\JhsShare.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\MvcFrameworkServiceFileViewer.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\JHeadstartDesignerGenerator.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\JAGLauncher.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\Bc4jPropertyEditor.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\JASEditor.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    So I try to test one of my old application with this configuration. After Jdeveloper migrated my workspace and projects and business componenet
    to the newer version, I run the application generator. It worked fine without any problem but after running the application, I got an error page showing
    that my bc4j.xcfg is not in the path.
    On the other hand, I found out that when I wanted to view my UIX pages, 2 dialog boxes appeared. The first one asked to upgrade
    to UIX 2.2's new expression language syntax and the other which is on the top of the first one, showing that UIX runtime failed to render the page
    with following detail :
    javax.servlet.ServletException: No page broker found!
         at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source)
         at oracle.cabo.servlet.UIXServlet.doGet(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at oracle.cuervo.share.servlet.PreviewServletContainer.handleRequest(PreviewServletContainer.java:305)
         at oracle.cuervo.share.servlet.PreviewServletContainer.handleRequest(PreviewServletContainer.java:229)
         at oracle.cabo.ide.addin.preview.UIXRenderThread._reallyLoad(UIXRenderThread.java:263)
         at oracle.cabo.ide.addin.preview.UIXRenderThread.runImpl(UIXRenderThread.java:203)
         at oracle.cabo.ide.addin.preview.BasePreviewThread.run(BasePreviewThread.java:79)
    I think that I should have set some setting before use JHeadstart with JDeveloper.
    Could anybody help me ?

    Alex,
    The document Sandra referred to applies to JDeveloper 10g preview (9.0.5.0). JHeadstart 9.0.4.5 will NOT work with JDeveloper 109 production (9.0.5.1).
    We plan to release a new version end of april that is compatible with 9.0.5.1. See this thread for more info: JDeveloper 10g production, status JHeadstart?
    Steven Davelaar,
    JHeadstart Team.

  • Use direct JDBC with CMP entity bean in one transaction

    I am trying to use direct JDBC call with CMP entity bean within a session
    bean method that requires transaction. The problem is that it appears these
    are not in the same transaction. When I use the JDBC call, the CMP entity
    bean update to the DB has not been committed yet.
    We are using Weblogic 5.1 SP6. The DB is Oracle.
    What I do for the JDBC is get a new connection from the pool using weblogic
    jdbc pool driver.
    Any help would be appreciated.
    Patrick

    Hi. You can do JDBC and invoke CMP EJBs and have this all treated
    as one transaction, if your hand-written code explicitly starts
    a JTS transaction, then uses the jts driver or a TxDataSource to
    get the JDBC connection. Then your code can call transactional
    EJBs and their work will be included in the transaction you started.
    Assuming the bean work went OK, and your manual JDBC went OK, you
    can manually commit the UserTransaction at that time. This is 5.1
    talk. For 6.0, with @PC, this may be even easier...
    Joe
    Patrick Shen wrote:
    >
    But if I do that, then they would not be in the same transaction anymore.
    Is there any way to use JDBC with CMP Entity bean in the same transaction?
    Patrick
    "L'artiste" <[email protected]> wrote in message
    news:[email protected]...
    Are you calling all the CMP create in the session Bean ? If so, beforeyou
    make the JDBC call from the session bean, the CMP in 2. should commit. Try
    to set its attribute to TX_REQUIRES_NEW. This way, the calling client will
    block until this transaction is done (committed) before the execution
    continues. There might be some overhead involved in doing so if you are
    anticipating a lot of users.
    "Patrick Shen" <[email protected]> wrote in message
    news:[email protected]...
    What I am trying to do is:
    In a Session bean method -
    1. create a new CMP entity bean (a new row in DB table)
    2. create another new CMP entity bean that uses previous bean as foreignkey
    3. use JDBC to update the row just created
    And all these 3 calls have to be in one transaction.
    Thanks,
    Patrick
    "L'artiste" <[email protected]> wrote in message
    news:[email protected]...
    Can you give a little bit more information?
    Do you have methods in your session bean that creates this CMP entitybeans?
    It looks like
    you might wanna try to change the isolation level to
    TRANSACTION_READ_COMITTED
    to preven dirty_read.
    "Patrick Shen" <[email protected]> wrote in message
    news:[email protected]...
    I am trying to use direct JDBC call with CMP entity bean within a
    session
    bean method that requires transaction. The problem is that it
    appears
    these
    are not in the same transaction. When I use the JDBC call, the CMP
    entity
    bean update to the DB has not been committed yet.
    We are using Weblogic 5.1 SP6. The DB is Oracle.
    What I do for the JDBC is get a new connection from the pool usingweblogic
    jdbc pool driver.
    Any help would be appreciated.
    Patrick
    PS: Folks: BEA WebLogic is expanding rapidly, with both entry and advanced positions
    for people who want to work with Java, XML, SOAP and E-Commerce infrastructure products.
    We have jobs at Nashua NH, Liberty Corner NJ, San Francisco and San Jose CA.
    Send resumes to [email protected]

  • Dynamic JDBC with JHeadstart

    Hi I have a problem using jheadstart when appliying dynamic jdbc credentials. I dont know why but my login page comes with errors . the picture of components does not come . for example the submit button comes with no picture but a cross sign (which happens when the picture is not found) and it is same for the other components.
    When I remove
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    from web.xml then they come but this time other pages are not found in navigation.
    What should I do?
    Certainly JHeadstart does override some parameters and this effects my pages. during start up. But I dont know why. You know what is so difficult about these frameworks. You have no knowledge of the underlying mechanism and when a problem occurs you can not figure out its reason . Actually I am complaning that you must write a book about JHeadstart with broader knowledge for users, guys. Without enough documentation you can not make people use it. So just think about it and please help me with my problem.
    expecting an answer soon
    write back quickly
    bye bye

    Hi,
    First, to reply to your remark about the JHeadstart team writing a book: we did! It's called the JHeadstart Developer's Guide and it's included in the JHeadstart release. Especially Chapter 5, JHeadstart Extensions to ADF Runtime, explains how the ADF Page Lifecycle works and how JHeadstart has extended that with extra functionality and how best practices have been implemented.
    Now to your problem with Dynamic JDBC: If the issue is related to the ADFBindingFilter, then it sounds like a generic JDeveloper/ADF problem, not JHeadstart specific. To simplify the test case, you could create a simple drag-and-drop ADF Application, apply the dynamic JDBC credentials to that application and see if the same problem occurs there. Then you can log a TAR at metaLink (http://metalink.oracle/com/), or ask this question at the JDeveloper forum at http://otn.oracle.com/discussionforums/jdev.html.
    Hope this helps,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Must I use spring Framework with JSF2 and Hibernate?

    Hi all,
    I'm starting to develop a web portal and I would use JSF2 and Hibernate.
    Now I don't know JSF2 so I searched some tutorial.
    I found a tutorial on JSF2 that seems very complete but in this tutorial I found a section where the author use Hibernate for the "model section", JSF2 for the "view section" and Spring for the "controller section"!
    Now I have a doubt, can I develop a web portal without Spring MVC or I can't develop any controller's component with JSF2?
    Thank you for your replies!

    For Ram, do you mean that JSF2 isn't a MVC framework with your reply?
    For Kayaman, the author did some examples how implements some frameworks with JSF2 and he do 3 examples:
    1) JSF2 and JDBC;
    2) JSF2 and Spring;
    3) JSF2, Spring and Hibernate!
    However, after this thread, I found a forum in linked to the tutorial and I asked why they use JSF2 and Spring together! Now Im waiting the answer!
    For Gimbla2: well, I'm novice on JSF2 but I develop for some years with ADF and JBO framework!
    You are right to tell me "On the official sites you can find all informations" but I would know some things from some one that used both frameworks!
    Thanks again to all.
    Edited by: Filippo Tenaglia on 20-giu-2011 14.16

  • Exception report when using tomcat 5 with JDBC

    i followed this guide to setup the JDBC with my TOMCAT 5
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
    but i seem to get this error
    exception
    javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
         org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:81)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276)
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159)
         org.apache.jsp.SID.test_jsp._jspx_meth_sql_query_0(test_jsp.java:100)
         org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:58)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    i can compile *.java and run them when they need the jdbc drivers to interact with mysql 5 database.
    This is my server.xml
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN" debug="0">
    <!-- Comment these entries out to disable JMX MBeans support -->
    <!-- You may also configure custom components (e.g. Valves/Realms) by
    including your own mbean-descriptor file(s), and setting the
    "descriptors" attribute to point to a ';' seperated list of paths
    (in the ClassLoader sense) of files to add to the default list.
    e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
    -->
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
    debug="0"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
    debug="0"/>
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 5 documentation bundle for more detailed
    instructions):
    * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
    later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    debug="0" connectionTimeout="20000"
    disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->
         <!-- Note : To use gzip compression you could set the following properties :
                   compression="on"
                   compressionMinSize="2048"
                   noCompressionUserAgents="gozilla, traviata"
                   compressableMimeType="text/html,text/xml"
         -->
    <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector port="8443"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" debug="0" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    -->
    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" debug="0"
    protocol="AJP/1.3" />
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector port="8082"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false"
    acceptCount="100" debug="0" connectionTimeout="20000"
    proxyPort="80" disableUploadTimeout="true" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
    <Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
    -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost" debug="0">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.4
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Global logger unless overridden at lower levels -->
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="catalina_log." suffix=".txt"
    timestamp="true"/>
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    debug="0" resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" debug="0" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <!-- Defines a cluster for this node,
    By defining this element, means that every manager will be changed.
    So when running a cluster, only make sure that you have webapps in there
    that need to be clustered and remove the other ones.
    A cluster has the following parameters:
    className = the fully qualified name of the cluster class
    name = a descriptive name for your cluster, can be anything
    debug = the debug level, higher means more output
    mcastAddr = the multicast address, has to be the same for all the nodes
    mcastPort = the multicast port, has to be the same for all the nodes
    mcastBindAddr = bind the multicast socket to a specific address
    mcastTTL = the multicast TTL if you want to limit your broadcast
    mcastSoTimeout = the multicast readtimeout
    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
    in case of multiple ethernet cards.
    auto means that address becomes
    InetAddress.getLocalHost().getHostAddress()
    tcpListenPort = the tcp listen port
    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
    has a wakup bug in java.nio. Set to 0 for no timeout
    printToScreen = true means that managers will also print to std.out
    expireSessionsOnShutdown = true means that
    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
    false means to replicate the session after each request.
    false means that replication would work for the following piece of code:
    <%
    HashMap map = (HashMap)session.getAttribute("map");
    map.put("key","value");
    %>
    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
    * Synchronous means that the thread that executes the request, is also the
    thread the replicates the data to the other nodes, and will not return until all
    nodes have received the information.
    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
    so the request thread will queue the replication request into a "smart" queue,
    and then return to the client.
    The "smart" queue is a queue where when a session is added to the queue, and the same session
    already exists in the queue from a previous request, that session will be replaced
    in the queue instead of replicating two requests. This almost never happens, unless there is a
    large network delay.
    -->
    <!--
    When configuring for clustering, you also add in a valve to catch all the requests
    coming in, at the end of the request, the session may or may not be replicated.
    A session is replicated if and only if all the conditions are met:
    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
    2. a session exists (has been created)
    3. the request is not trapped by the "filter" attribute
    The filter attribute is to filter out requests that could not modify the session,
    hence we don't replicate the session after the end of this request.
    The filter is negative, ie, anything you put in the filter, you mean to filter out,
    ie, no replication will be done on requests that match one of the filters.
    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
    ending with .gif and .js are intercepted.
    The deployer element can be used to deploy apps cluster wide.
    Currently the deployment only deploys/undeploys to working members in the cluster
    so no WARs are copied upons startup of a broken node.
    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
    When a new war file is added the war gets deployed to the local instance,
    and then deployed to the other instances in the cluster.
    When a war file is deleted from the watchDir the war is undeployed locally
    and cluster wide
    -->
    <!--
    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
    expireSessionsOnShutdown="false"
    useDirtyFlag="true">
    <Membership
    className="org.apache.catalina.cluster.mcast.McastService"
    mcastAddr="228.0.0.4"
    mcastPort="45564"
    mcastFrequency="500"
    mcastDropTime="3000"/>
    <Receiver
    className="org.apache.catalina.cluster.tcp.ReplicationListener"
    tcpListenAddress="auto"
    tcpListenPort="4001"
    tcpSelectorTimeout="100"
    tcpThreadCount="6"/>
    <Sender
    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
    replicationMode="pooled"/>
    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
    tempDir="/tmp/war-temp/"
    deployDir="/tmp/war-deploy/"
    watchDir="/tmp/war-listen/"
    watchEnabled="false"/>
    </Cluster>
    -->
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn"
    debug="0"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Logger shared by all Contexts related to this virtual host. By
    default (when using FileLogger), log files are created in the "logs"
    directory relative to $CATALINA_HOME. If you wish, you can specify
    a different directory with the "directory" attribute. Specify either a
    relative (to $CATALINA_HOME) or absolute path to the desired
    directory.-->
    <Logger className="org.apache.catalina.logger.FileLogger"
    directory="logs" prefix="localhost_log." suffix=".txt"
    timestamp="true"/>
              <Context path="/testdb" docBase="APACHE_DIR/htdocs/testdb"
    debug="5" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Resource name="jdbc/TestDB"
    auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <!-- Maximum number of dB connections in pool. Make sure you
    configure your mysqld max_connections large enough to handle
    all of your db connections. Set to 0 for no limit.
    -->
    <parameter>
    <name>maxActive</name>
    <value>10</value>
    </parameter>
    <!-- Maximum number of idle dB connections to retain in pool.
    Set to 0 for no limit.
    -->
    <parameter>
    <name>maxIdle</name>
    <value>5</value>
    </parameter>
    <!-- Maximum time to wait for a dB connection to become available
    in ms, in this example 10 seconds. An Exception is thrown if
    this timeout is exceeded. Set to -1 to wait indefinitely.
    -->
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <!-- MySQL dB username and password for dB connections -->
    <parameter>
    <name>username</name>
    <value>test</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>testpwd</value>
    </parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to your MySQL dB.
    The autoReconnect=true argument to the url makes sure that the
    mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
    connection. mysqld by default closes idle connections after 8 hours.
    -->
    <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost/testdb?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
         </Context>
    </Host>
    </Engine>
    </Service>
    </Server>

    You haven't added a resource reference for your web application that gives the application a local name for the global resource "UserDatabase".

  • Can Stored procedure with IN and OUT Paramter can be used in JDBC LOOKUP?

    can Stored procedure with IN and OUT Paramter can be used in JDBC LOOKUP?

    Checking online help, I do not see any possibility.
    "Queries a data base by the given SQL statement."
    http://help.sap.com/javadocs/pi/pi711sp03/com/sap/aii/mapping/lookup/DataBaseAccessor.html
    -> execute

  • Problem with Using Spring IoC and Web Start

    Greetings Everyone,
    I have a small Swing app that runs using spring to load its dependencies. I can run it from a single signed jar file locally, and I setup my .jnlp file to try it with Web Start.
    Unfortunately, I get the following:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         at java.security.AccessController.checkPermission(AccessController.java:546)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
         at java.lang.Class.checkMemberAccess(Class.java:2157)
         at java.lang.Class.getDeclaredMethods(Class.java:1790)
         at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:429)
         at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:412)
         at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:363)
         at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:296)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:745)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:448)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
         at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
         at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
         at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:597)
         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:366)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
         at org.chibgrant.main.MainPOE.main(MainPOE.java:31)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.javaws.Launcher.executeApplication(Launcher.java:1321)
         at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1267)
         at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1066)
         at com.sun.javaws.Launcher.run(Launcher.java:116)
         at java.lang.Thread.run(Thread.java:619)
    I am running build 1.6.0_13-b03. Anyone run into this before?
    Thanks for any insights...!

    I suspect you may have solved this yourself by now, but in case not.
    I've recently created a desktop application that uses Spring and is launched via Java Web Start and I did have a problem getting it to launch via Web Start until I modified my code to ensure the classloader setup is done before any Spring methods are called.
    i.e.
        // This is needed for Java Web Start compatibility.
        UIManager.getLookAndFeelDefaults().put("ClassLoader", Loader.class.getClassLoader());In may application this code is invoked in the class that starts my application (Loader) before I load anything via Spring.
    Cheers,
    Stephen.

  • Cannot use Spring 2.0 final with Workshop Studio 3.2_569

    It seems to be impossible to use Spring 2.0 final with the latest Studio. When attempting to define an alternate Spring library (the Studio download is still a CR release), you'll receive an error dialog complaining about a missing OJB jar file from the Spring distribution.
    This jar file is missing, but on purpose--it appears that with the 2.0 final release, support for Apache OJB was removed from the main Spring distribution and moved to the Spring modules project.
    Any chance we'll get a Studio update to resolve this issue, or provide a final Spring 2.0 version download within Workshop?

    The BEA Workshop release 3.2 & 3.2.1 (build 569 & 589 respectively), does not bundle Spring 2.0 final and is also not aware of this release.
    However, this should not stop you from manually importing the Spring 2.0 libraries into Workshop.
    Preferences | Workshop Studio Facet Libraries | Spring Library is used by the "New Web app" and "Project Facet" wizard to import the libraries on creation. Instead you can manually copy/overwrite Spring 2.0 libraries in your existing project.We will keep you posted on the Spring 2.0 support release.

  • Workaround for using Oracle JDBC extension with WLS pooling

    Reading the newsgroup I saw that many of us encountered the problems
    with ClassCastException when tried to use Oracle JDBC extension
    with WLS pooling. I also had.
    In this case BEA recommends to use dangerous
    method getVendorConnection() which exposes
    the physical connection object to your code.
    Yes it's really dangerous because of unsafe usage may breaks
    WLS pooled connection(s).
    Moreover, this practice will make your JDBC code
    unportable (your JDBC code in addition to Oracle dependence
    became Weblogic dependent):
    void doSmth() {
    Connection con = ...;
    Connection vCon = ((WLConnection)con).getVendorConnection();
    // + mess of usage con in one places and vCon in others
    // (where Oracle extensions are needed)
    // !Don't forget to don't close vCon!
    Sux.
    I found the workaround.
    Introduction
    ============
    Yes the real cause of ClassCastException is that
    in depth of Oracle driver the casting
    to class oracle.jdbc.driver.OracleConnection
    (not to interface oracle.jdbc.OracleConnection)
    is performed.
    Someone can say that this is bug or pure desing.
    Weblogic pooled connection provide dynamic
    implementation for all public interfaces
    which real physical (wrapped) connection object implements.
    Great feature!
    But I guess that all interface methods implemented
    by simple call-delegation to physical (wrapped) connection object.
    In case of oracle.jdbc.OracleConnection interface
    this approach doesn't work for at least one its method:
    public OracleConnection unwrap()
    WLS pooled connection shoudn't implement this method by
    delegation to physical connection object BUT should
    return physical connection object itself!
    // Wrong implementation of unwrap()
    // delegation is used
    public OracleConnection unwrap() {
    return physicalConnection.unwrap();
    // Right implementation of unwrap()
    // physical connection returned
    public OracleConnection unwrap() {
    return physicalConnection;
    Workaround
    ==========
    1. Develop your own OracleConnection wrapper class:
    import oracle.jdbc.OracleConnection;
    import weblogic.jdbc.extensions.WLConnection;
    public class MyOracleConnectionImpl implements OracleConnection {
    private OracleConnection con;
    public MyOracleConnectionImpl(OracleConnection connection)
    throws SQLException
    this.con = connection;
    public OracleConnection unwrap() {
    return (OracleConnection)
    ((WLConnection)con).getVendorConnection();
    /* Implement all other methods by delegation to con object */
    2. Don't get Connections directly from DataSource --
    develop your own simple (may be static) utility
    class which retrives Connections from dataSource
    and returns them wrapped into your MyOracleConnectionImpl
    to your code from some method:
    puclic abstract class MyConnectionSource {
    public static Connection getConnection() {
    Connection con = // get it from DataSource
    return new MyOracleConnectionImpl((OracleConnection)con);
    3. Add attribute RemoveInfectedConnectionsEnabled="false"
    to definition of your JDBCConnectionPool within config.xml
    You may do it because of you `safely` use vendorConnection --
    you don't expose it to application code.
    4. Enjoy the Oracle JDBC extensions in your code!
    Example:
    Connection con = MyConnectionSource.getConnection;
    ArrayDescriptor add =
    ArrayDescriptor.createDescriptor("your_type", con);
    Hope it helps to someone.
    Best regards,
    Eugene Voytitsky

    Hello Eugene Voytitsky,
    Thanks Eugene Voytitsky for your idea
    I have tried the solution suggested by You, but it did not work.
    It still throws ClassCastException.
    I am sorry for posting the whole code of two classes below.
    I did this to give you more clarity.
    I am also indicating the place where the exception was thrown..
    Please let me know if I am doing something wrong.
    OracleConnection Wrapper class
    package ejbTesting;
    // sql imports
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import java.sql.SQLWarning;
    import java.sql.Statement;
    // util imports
    import java.util.Map;
    import java.util.Properties;
    // imports from Oracle Driver Classes
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OracleOCIFailover;
    import oracle.jdbc.OracleSavepoint;
    // import from Weblogic extensions
    import weblogic.jdbc.extensions.WLConnection;
    public class WeblogicConnectionWrapper implements OracleConnection
         // oracle connection object
         private OracleConnection connection;
         public WeblogicConnectionWrapper (OracleConnection orclConnection)
              try
                   this.connection = orclConnection;
              catch(Exception unexpected )
                   unexpected.printStackTrace();
         public OracleConnection unwrap()
              try
              // The datasource returns a weblogic.jdbc.pool.Connection
              // This needs to be type casted to weblogic.jdbc.extensions.WLConnection
              // Only this weblogic.jdbc.extensions.WLConnection CAN BE type casted
              // to OracleConnection
         return (OracleConnection) ((WLConnection) connection).getVendorConnection();
         catch(Exception sqlException )
              sqlException.printStackTrace ();
              return null;
         /* Implement all other methods by delegation to connection object */      
    public Connection _getPC()
    return connection._getPC();
    public void archive(int i, int j, String s)
    throws SQLException
    connection.archive(i, j, s);
    public void assertComplete()
    throws SQLException
    connection.assertComplete();
    public void clearWarnings()
    throws SQLException
    connection.clearWarnings();
    public void close()
    throws SQLException
    connection.close();
    public void commit()
    throws SQLException
    connection.commit();
    public Statement createStatement()
    throws SQLException
    return connection.createStatement();
    public Statement createStatement(int i, int j)
    throws SQLException
    return connection.createStatement(i, j);
    public boolean getAutoClose()
    throws SQLException
    return connection.getAutoClose();
    public boolean getAutoCommit()
    throws SQLException
    return connection.getAutoCommit();
    public CallableStatement getCallWithKey(String s)
    throws SQLException
    return connection.getCallWithKey(s);
    public String getCatalog()
    throws SQLException
    return connection.getCatalog();
    public boolean getCreateStatementAsRefCursor()
    return connection.getCreateStatementAsRefCursor();
    public int getDefaultExecuteBatch()
    return connection.getDefaultExecuteBatch();
    public int getDefaultRowPrefetch()
    return connection.getDefaultRowPrefetch();
    public Object getDescriptor(String s)
    return connection.getDescriptor(s);
    public boolean getExplicitCachingEnabled()
    throws SQLException
    return connection.getExplicitCachingEnabled();
    public boolean getImplicitCachingEnabled()
    throws SQLException
    return connection.getImplicitCachingEnabled();
    public boolean getIncludeSynonyms()
    return connection.getIncludeSynonyms();
    public Object getJavaObject(String s)
    throws SQLException
    return connection.getJavaObject(s);
    public DatabaseMetaData getMetaData()
    throws SQLException
    return connection.getMetaData();
    public Properties getProperties()
    return connection.getProperties();
    public boolean getRemarksReporting()
    return connection.getRemarksReporting();
    public boolean getRestrictGetTables()
    return connection.getRestrictGetTables();
    public String getSQLType(Object obj)
    throws SQLException
    return connection.getSQLType(obj);
    public String getSessionTimeZone()
    return connection.getSessionTimeZone();
    public int getStatementCacheSize()
    throws SQLException
    return connection.getStatementCacheSize();
    public PreparedStatement getStatementWithKey(String s)
    throws SQLException
    return connection.getStatementWithKey(s);
    public int getStmtCacheSize()
    return connection.getStmtCacheSize();
    public short getStructAttrCsId()
    throws SQLException
    return connection.getStructAttrCsId();
    public boolean getSynchronousMode()
    return connection.getSynchronousMode();
    public int getTransactionIsolation()
    throws SQLException
    return connection.getTransactionIsolation();
    public Map getTypeMap()
    throws SQLException
    return connection.getTypeMap();
    public String getUserName()
    throws SQLException
    return connection.getUserName();
    public boolean getUsingXAFlag()
    return connection.getUsingXAFlag();
    public SQLWarning getWarnings()
    throws SQLException
    return connection.getWarnings();
    public boolean getXAErrorFlag()
    return connection.getXAErrorFlag();
    public boolean isClosed()
    throws SQLException
    return connection.isClosed();
    public boolean isLogicalConnection()
    return connection.isLogicalConnection();
    public boolean isReadOnly()
    throws SQLException
    return connection.isReadOnly();
    public String nativeSQL(String s)
    throws SQLException
    return connection.nativeSQL(s);
    public Object openJoltConnection(String s, short word0, short word1)
    return connection.openJoltConnection(s, word0, word1);
    public void oracleReleaseSavepoint(OracleSavepoint oraclesavepoint)
    throws SQLException
    connection.oracleReleaseSavepoint(oraclesavepoint);
    public void oracleRollback(OracleSavepoint oraclesavepoint)
    throws SQLException
    connection.oracleRollback(oraclesavepoint);
    public OracleSavepoint oracleSetSavepoint()
    throws SQLException
    return connection.oracleSetSavepoint();
    public OracleSavepoint oracleSetSavepoint(String s)
    throws SQLException
    return connection.oracleSetSavepoint(s);
    public int pingDatabase(int i)
    throws SQLException
    return connection.pingDatabase(i);
    public CallableStatement prepareCall(String s)
    throws SQLException
    return connection.prepareCall(s);
    public CallableStatement prepareCall(String s, int i, int j)
    throws SQLException
    return connection.prepareCall(s, i, j);
    public CallableStatement prepareCallWithKey(String s)
    throws SQLException
    return connection.prepareCallWithKey(s);
    public PreparedStatement prepareStatement(String s)
    throws SQLException
    return connection.prepareStatement(s);
    public PreparedStatement prepareStatement(String s, int i, int j)
    throws SQLException
    return connection.prepareStatement(s, i, j);
    public PreparedStatement prepareStatementWithKey(String s)
    throws SQLException
    return connection.prepareStatementWithKey(s);
    public void purgeExplicitCache()
    throws SQLException
    connection.purgeExplicitCache();
    public void purgeImplicitCache()
    throws SQLException
    connection.purgeImplicitCache();
    public void putDescriptor(String s, Object obj)
    throws SQLException
    connection.putDescriptor(s, obj);
    public void registerApiDescription(String s, short word0, short word1, String
    s1)
    connection.registerApiDescription(s, word0, word1, s1);
    public void registerSQLType(String s, Class class1)
    throws SQLException
    connection.registerSQLType(s, class1);
    public void registerSQLType(String s, String s1)
    throws SQLException
    connection.registerSQLType(s, s1);
    public void registerTAFCallback(OracleOCIFailover oracleocifailover, Object
    obj)
    throws SQLException
    connection.registerTAFCallback(oracleocifailover, obj);
    public void rollback()
    throws SQLException
    connection.rollback();
    public void setAutoClose(boolean flag)
    throws SQLException
    connection.setAutoClose(flag);
    public void setAutoCommit(boolean flag)
    throws SQLException
    connection.setAutoCommit(flag);
    public void setCatalog(String s)
    throws SQLException
    connection.setCatalog(s);
    public void setCreateStatementAsRefCursor(boolean flag)
    connection.setCreateStatementAsRefCursor(flag);
    public void setDefaultExecuteBatch(int i)
    throws SQLException
    connection.setDefaultExecuteBatch(i);
    public void setDefaultRowPrefetch(int i)
    throws SQLException
    connection.setDefaultRowPrefetch(i);
    public void setExplicitCachingEnabled(boolean flag)
    throws SQLException
    connection.setExplicitCachingEnabled(flag);
    public void setImplicitCachingEnabled(boolean flag)
    throws SQLException
    connection.setImplicitCachingEnabled(flag);
    public void setIncludeSynonyms(boolean flag)
    connection.setIncludeSynonyms(flag);
    public void setReadOnly(boolean flag)
    throws SQLException
    connection.setReadOnly(flag);
    public void setRemarksReporting(boolean flag)
    connection.setRemarksReporting(flag);
    public void setRestrictGetTables(boolean flag)
    connection.setRestrictGetTables(flag);
    public void setSessionTimeZone(String s)
    throws SQLException
    connection.setSessionTimeZone(s);
    public void setStatementCacheSize(int i)
    throws SQLException
    connection.setStatementCacheSize(i);
    public void setStmtCacheSize(int i)
    throws SQLException
    connection.setStmtCacheSize(i);
    public void setStmtCacheSize(int i, boolean flag)
    throws SQLException
    connection.setStmtCacheSize(i, flag);
    public void setSynchronousMode(boolean flag)
    connection.setSynchronousMode(flag);
    public void setTransactionIsolation(int i)
    throws SQLException
    connection.setTransactionIsolation(i);
    public void setTypeMap(Map map)
    throws SQLException
    connection.setTypeMap(map);
    public void setUsingXAFlag(boolean flag)
    connection.setUsingXAFlag(flag);
    public void setWrapper(OracleConnection oracleconnection)
    connection.setWrapper(oracleconnection);
    public void setXAErrorFlag(boolean flag)
    connection.setXAErrorFlag(flag);
    public void shutdown(int i)
    throws SQLException
    connection.shutdown(i);
    public void startup(String s, int i)
    throws SQLException
    connection.startup(s, i);
    Util class to get Wrapped Connections from
    datasource
    package ejbTesting;
    // j2ee imports
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    // sql imports
    import java.sql.Connection;
    // imports from Oracle Driver Classes
    import oracle.jdbc.OracleConnection;
    * Wrapper class for the DataSource Connection from Weblogic pool
    public class DataSourceConnectionWrapper
         // datasource variable
         private static transient DataSource datasource = null;
         private static String dbName = "jdbc/workbench";
    * Method that returns the database connection
         public static Connection getConnection()
              try
                   // initialsing the datasource object
                   initialiseDataSource ();
                   // Getting a connection from the datasource
                   Connection con = datasource.getConnection( );
                   // wrapping it custom wrapper class and
                   // returning the connection object
                   return new WeblogicConnectionWrapper((OracleConnection)con);
              catch(Exception exception )
                   exception.printStackTrace();
                   return null;
         private static void initialiseDataSource( ) throws Exception
    if ( datasource == null )
    try
    InitialContext ic = new InitialContext( );
    datasource = (DataSource) ic.lookup( dbName );
    catch (Exception ne )
    throw new Exception( "NamingException while looking up DataSource with
    JNDI name" +
    dbName + ": \n" + ne.getMessage( ) );
    Exception Stack Trace
    The line 46 in DataSourceConnectionWrapper
    corresponds to
    return new WeblogicConnectionWrapper((OracleConnection)con);
    Which I feel is logical as the connection which we get from Weblogic
    datasource cannot be type casted to OracleConnection
    java.lang.ClassCastException: weblogic.jdbc.pool.Connection
    at ejbTesting.DataSourceConnectionWrapper.getConnection(DataSourceConnectionWrapper.java:46)

  • How to use bounding theme with jdbc theme

    Hello
    I'm using oracle maps javascript API to locate geometry with jdbc theme based foi, so how to use bounding theme with jdbc theme? Give me help, thanks.

    Hi,
    You can find some information & code samples at this link :-
    http://download-west.oracle.com/docs/cd/B19306_01/java.102/b14355/xadistra.htm#g1077100
    Regards,
    Sandeep

  • How to use unload query using JDBC with Informix database

    Hi friends,
    How can i use unload query using JDBC with Informix database?
    When i use it as "unload to 'abc.txt' select * from ........" it gives syntax error.I want to take the data of a table to a file.With dbaccess i can use it but i need to do it using jdbc.
    Thanks,
    Raneesh.

    To the best of my ability to tell, the right way to use this product from within Power Query would be to use its API. Unfortunately, we don't currently support either of the methods needed to be able to authenticate with the service (OAuth 2.0 and a relatively-custom
    digest-based method). Adding a mechanism to allow use of arbitrary OAuth-protected resources is a fairly high priority for us, and I hope we'll be able to deliver something before mid-2015.
    Scraping the website is very hard to do well -- both from an authentication and from a data discovery perspective.

  • Using Oracle8 JDBC Drivers with WebLogic 5.1

    We are currently using the BEA WebLogic 5.1 application server and Oracle 8.0.4. We are using the JDBC OCI driver that came out-of-the-box with the WebLogic software. However, we would like to use the driver developed by Oracle, instead.
    Does the Oracle8 JDBC driver (both type 2 and type 4) interoperate with WebLogic 5.1? If not, what are the problems that prohibit them being used together?
    Thanks... Steve Bursch

    Summarizing from previous threads on this forum (I have not run this configuration myself):
    The main issue is that you will not be able to use Oracle-specific functionality from the Oracle driver.
    This includes all types in oracle.sql, or any APIs on oracle.jdbc.driver.OracleXxxx classes, or JPublisher-generated wrappers for SQL Object Types, collections, or REFs.
    Also, since Oracle does not support side-channel result sets, but requires explicit REF CURSOR out parameters from stored procedures/functions, you will not be able to return REF CURSORs to the client, from stored proedures or functions - the getCursor() API that is required is Oracle-specific and not part of JDBC.
    As long as you limit yourself strictly to standard JDBC types, and do not require the return of result sets from the server, you should probably be fine.

  • How use jdbc with swing ? i am new in this concept.

    hi
    freinds,
    i am new in java can any one give the example which explain the how to use jdbc with swing.
    thanks in advace.
    satish
    thanks.

    See here  >  http://support.apple.com/kb/HT4236
    More info in the User Guides for your Devices...

  • Can I use subtype/supertype Entity Object with JHeadstart ?

    Hi,
    I am using Generalization on our entity object design, i,e : Employee(SuperType), Hourly_Employee(SubType), SalariedEmployee(SubType), Consoltant(SubType). The attributes attached below.
    All SubTypes will EXTEND the supertype : Employee.
    The questions are :
    Can JHeadstart handle the generalized entity objects ?
    How can the UI look like with JHeadstart ?
    Thank you for your help,
    Krist
    Supertype : Employee
    Employee_Number
    Employee_Name
    Address
    Employee_Type
    Date_Hired
    SubType : Hourly_Employee
    Hourly_Rate
    SubType : Salaried_Employee
    Annual_Salary
    Stock_Options
    SubType : CONSULTANT
    Contract_Number
    Billing_Rate

    Krist,
    If I understand you correctly you want to have a number of View Object attributes in a page to be accessible through 'subtabs', and want the correct subtab to be shown when the 'discriminator' field is changed. I am sorry for the confusion, I got thrown off track with all the super-subtype Entity details, but in the UI you are only dealing with ViewObject (usages), and not Entity Objects.
    Anyway, we can not generate 'subtabs'. There is a feature on our 'Enhancement list' to make the Regions have a 'stacked' property, which I think would come pretty close to what you need: you could group ViewObject Atributes together in Regions, and 'stacked' Regions would be generated as tab pages. We have not implemented this feature yet, and even if we had, you would have to change it post-gen because in your case, you would not want the end user to be able to 'switch tabs', but only a change of the 'discrimitator' field should do that.
    We have shipped some templates, though, for creating subtabs for child groups. Perhaps you could take a look if some of that code could be useable for your.
    I would suggest the following approach:
    1.) In the application structure file, create 'Regions' for all subtypes, and in the BC4J Property Editor, assign the 'subtype' attributes to the corresponding Region.
    2.) Regenerate the page. Now you should have a separate 'header' element for each subtype, containing the appropriate attributes.
    3.) Now you will need to transform those 'headers' to 'subtype tabs'. You could do that by borrowing code from our 'tabbed child' templates, or, alternatively, you could use a similar, Javascript-based technique that we use for switching between Quick Search and Advanced Search.
    4.) Finally, you should device a mechanism to change the active tab when changing the 'discriminator' column in the area above the tabs, with the supertype fields.
    Hope this helps,
    Peter Ebell
    JHeadstart Team

Maybe you are looking for