Oracle db with bean

how can i use beans to do connection to oracle db,in jsp pages?

i would lik have an exemple of a bean that make connction to oracle data base!ohh, look at the SUN JDBC tutorial . use ur own url and password to connect to the DB. thats it . Nothing special you require.

Similar Messages

  • Oracle RAC with Admin tools

    Hello!
    I use Weblogic Server 10.3.2. I have a portal application and I want to manage the content with Portal Administration Console from admin-tools.war . Admin-tools is a part of my portal application. I eclipse I check for my ear project on Project Facets : Admin Console, Admin Framework, Portal Application Services, Portal Customizations Framework.
    I have a cluster with two servers. As a database I use Oracle 10 with two instances : instance 1, instance 2. I have created my domain with wizard and I checked RAC Multidatasources.
    All datasources and multidatasources are targeted to my weblogic cluster, also where is deployed my app and Portal Administration Console ( admin-tools.war).
    I use the multidatasources :
    Multidatasource Name : cgDataSource JNDI:      cgDataSource     Load-Balancing     
    Oracle Driver for data sources cgDataSource-rac0, cgDataSource-rac1 : oracle.jdbc.xa.client.OracleXADataSource
    MultiDataSource Name : cgDataSource-nonXA     JNDI : cgDataSource-nonXA      Load-Balancing     Oracle Driver:
    Oracle driver for datasources from multidatasource : oracle.jdbc.OracleDriver . Supports Global Transaction
    Name : p13nDataSource
    JNDI : p13n.trackingDataSource,p13n.sequencerDataSource,cm.sequencerDataSource,p13n.leasemanager,p13n.dataSyncDataSource,p13n.entitlementsDataSource,p13n.jobManagerDataSource,p13n.quiescenceDataSource,p13n.credentialsDataSource     Load-Balancing     
    Oracle driver for datasources from multidatasource: oracle.jdbc.OracleDriver .
    !!DOESN'T Supports Global Transaction!!
    Name: portalDataSource     
    JNDI : weblogic.jdbc.jts.commercePool contentDataSource contentVersioningDataSource portalFrameworkPool     Load-Balancing     
    Oracle driver for datasources from multidatasource: oracle.jdbc.OracleDriver .
    Supports Global Transaction
    Name: portalDataSourceAlwaysXA     
    JNDI : portalFrameworkPoolAlwaysXA     Load-Balancing     
    Oracle driver for datasources from multidatasource: oracle.jdbc.xa.client.OracleXADataSource
    Name: portalDataSourceNeverXA JNDI: portalFrameworkPoolNeverXA
    Oracle driver for datasources from multidatasource: oracle.jdbc.xa.client.OracleXADataSource
    But when I try to add a content, after a server restart, I receive the following error :
    <Error> <PortalAdminTools> <sun1> <Server-0> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <> <1289472419642> <BEA-415097> <A RepositoryException was thrown: java.sql.BatchUpdateException: ORA-00001: unique constraint (WEBLOGIC_PORTAL_PROD.PK_CM_PROPERTY) violated
    com.bea.content.RepositoryException: java.sql.BatchUpdateException: ORA-00001: unique constraint (WEBLOGIC_PORTAL.PK_CM_PROPERTY) violated
         at com.bea.content.internal.server.common.dbaction.Batcher.processWithRetries(Batcher.java:148)
         at com.bea.content.internal.server.common.dbaction.Batcher.processAnyRemainingItems(Batcher.java:86)
         at com.bea.content.repo.internal.server.dao.PropertyDao.insert(PropertyDao.java:383)
         at com.bea.content.repo.internal.server.persister.JDBCNodePersister.createNode(JDBCNodePersister.java:148)
         at com.bea.content.repo.internal.server.logic.NodeOpsLogic.create(NodeOpsLogic.java:227)
         at com.bea.content.repo.internal.server.bean.NodeOpsBean.create(NodeOpsBean.java:106)
         at com.bea.content.repo.internal.server.bean.RepoNodeOps_ehgg7y_ELOImpl.create(RepoNodeOps_ehgg7y_ELOImpl.java:323)
         at com.bea.content.repo.internal.client.common.Node.create(Node.java:123)
         at com.bea.content.spi.internal.NodeOpsImpl.createNode(NodeOpsImpl.java:823)
         at com.bea.content.spi.internal.ExtendedNodeOpsImpl.createNodeWithNodeTypeAndObjectClassAndWorkflow(ExtendedNodeOpsImpl.java:81)
         at com.bea.content.federated.internal.delegate.LatestInterfaceVersionWrapper.invoke(LatestInterfaceVersionWrapper.java:72)
         at $Proxy457.createNodeWithNodeTypeAndObjectClassAndWorkflow(Unknown Source)
         at com.bea.content.federated.internal.filter.logging.NOPSLoggingFilter.createNodeWithNodeTypeAndObjectClassAndWorkflow(NOPSLoggingFilter.java:111)
         at com.bea.content.federated.internal.delegate.NodeLogic.createNodeWithType(NodeLogic.java:275)
    Caused By: java.sql.BatchUpdateException: ORA-00001: unique constraint (WEBLOGIC_PORTAL.PK_CM_PROPERTY) violated
         at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:629)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9447)
         at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:211)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:191)
    What is the problem? Please tell me if you need more details about my configuration and problem.

    This issue is beyond simple WLS JDBC. I suggest opening a WLS portal bug.

  • Oracle AQ with Orion 2.0 application server

    Hi,
    I'm trying to use Oracle AQ/JMS as queue for a J2EE message driven bean running in an Orion 2.0 application server.
    To connect the bean with the queue I have to configure a resource provider. By now, the only resource provider I found is the class oracle.jms.OjmsContext witch is included in the oc4j.jar file of oracles J2EE container.
    So the question is, is there a way to use Oracle AQ as infrastructure for message driven beans with other J2EE servers then Oracles OC4J?
    Thanks in advance.
    Alexander Schulz

    Tanks 327 for your reply.
    I think you got me a little wrong (because of my poor english).
    I hoped that somebody can tell me if there is a java library (jar) that I can use to use Oracle AQ with Orion 2.0 for message driven beans.
    I'm wondering why the class OjmsContext is only availiable in the main jar of the Oracle J2EE container. I think it would be very usefull to have an extra library containing all the stuff needed to use AQ with other application servers.
    Alexander Schulz

  • Oracle XMLType with CMP EJBs

    Hi!
    I am currently trying to use Oracles XMLType with EJBs. Preferrably I would like to use CMP. Although the documentation http://e-docs.bea.com/wls/docs81/jdbc_drivers/oracle.html#1067224
    says that XMLType is mapped to a CLOB, I get an error
    ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
    when trying to update it. (I marked the bean as dbms-column-type OracleClob). If I do not mark it as OracleClob, I get an SQLException invalid type sqlType=2007 .
    Is there another way to make XMLType work?
    Thanks so much,
    Hans-Peter Stoerr
    PS: We are using Bea Weblogic Portal 8.1, but might migrate to 9. The driver is the oracle thin driver with oracle 9.2.

    Hi Brian,
    Im not sure whats the issue with using DB Triggers. You could possibly have another
    column(s) for created_by and updated_by and still use triggeres for the create_time
    and update_time.
    Inheritance would make it better if u have multiple tables which need the same
    behaviour but the above solution maybe the easy one.
    -Raj
    "Brian Preston" <[email protected]> wrote:
    >
    Our DB has 4 'audit' columns : create_date, created_by, last_update_date,
    last_updated_by.
    We're currently not using ejbs, just J2SE, servlets & jsps, but I'm looking
    into
    using ejbs.
    Is there any kind of design pattern for this? I've been searching the
    newsgroups
    about this. I can't use DB triggers because our application connects
    to the DB
    as the same user, regardless of the application user.
    I'm trying to use inheritance as well, have a 'base' object that has
    these audit
    columns and have all the ejbs extend that base class.
    Another issue is how would I trigger setting these columns? Do I have
    to store
    all the column values in ejbLoad and compare them in ejbStore? I've also
    read
    a little about the javax.ejb.SessionSynchronization interface, can I
    use that?
    Thanks,
    Brian Preston

  • Problem when trying to refresh oracle screens with latest data

    hello experts,
    i have one problem,i want to refresh the oracle screen with the latest data from the data
    base.
    It is a two stage process.At first step one user will select a row from the screen and then he will press a button .
    now the second screen will appear and the detail of the employee will be displayed.
    First step has been completed and the data is coming in the second form via parameters and i can see the full information of the employee.
    Now i want to refresh the oracle form i.e. suppose if my dba has made any changes in the oracle table( EMP table) i want that after pressing the refresh button user can see the
    latest data from the database.
    in WHEN_BUTTON_PRESSED trigger i have written this codes.
    enter_query;
    execute_query;
    but they are not giving the expected result.
    And one more thing please suggest whether in the second form i should use database item
    or non database item.
    When i am using database item when i am trying to close second from one pop up is appearing
    and asking that whether i want to save the changes.
    please suggest how can i remove this message from my application.
    Regards
    Anutosh

    Hi,
    what data did you transfer via parameters to the second form ?
    how did you populate the datablock in the second form ?
    Typical solution would be:
    (For my example the block is both forms is named EMP, and is based on the table SCOTT.EMP)
    In Form 1, transfer the primary key-value of the current record to a global or parameter (will use global in my example):
    e.g. you have a WHEN-BUTTON-PRESSED-Trigger with the following code:
    <pre>
    :GLOBAL.EMPNO:=:EMP.EMPNO;
    CALL_FORM('FORM2');
    </pre>
    In Form 2, you have a WHEN-NEW-FORM-INSTANCE-Trigger with code:
    <pre>
    DEFAULT_VALUE('GLOBAL.EMPNO', NULL);
    IF :GLOBAL.EMPNO IS NOT NULL THEN
    GO_BLOCK('EMP');
    EXECUTE_QUERY;
    :GLOBAL.EMPNO:=NULL;
    END IF;
    </pre>
    On block EMP in Form 2 there is a PRE-QUERY-Trigger with following code:
    <pre>
    IF :GLOBAL.EMPNO IS NOT NULL THEN
    :EMP.EMPNO:=:GLOBAL.EMPNO;
    END IF;
    </pre>
    And at last, in your refresh-button would be the following code:
    <pre>
    :GLOBAL.EMPNO:=:EMP.EMPNO;
    GO_BLOCK('EMP');
    EXECUTE_QUERY;
    :GLOBAL.EMPNO:=NULL;
    </pre>
    Hope this helps

  • Unable to integrate Oracle Reports with Express--(To oracle Team also)

    Hi
    Unable to integrate Oracle Reports with Express. While defining
    the Express database connection using the olap connection editor
    iam getting the following error "Error locating the XCONEDIT.INI
    file. Try re-installing the software".
    what should be done?
    Atleat,If anybody has successfully connected to Express via
    Reports6i. Kindly give the details like what softwares to be
    installed in what HOME? and also other steps involved in the
    process.
    YOur help !!!
    kindly respond...(Oracle Team do respond with something)
    with rgds

    hello,
    check out the notes
    Note:112542.1
    Note:167049.1
    on oracle metalink for further information.
    if you still have issues, please contact oracle support services
    for furhter assistence.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to use Oracle partitioning with JPA @OneToOne reference?

    Hi!
    A little bit late in the project we have realized that we need to use Oracle partitioning both for performance and admin of the data. (Partitioning by range (month) and after a year we will move the oldest month of data to an archive db)
    We have an object model with an main/root entity "Trans" with @OneToMany and @OneToOne relationships.
    How do we use Oracle partitioning on the @OneToOne relationships?
    (We'd rather not change the model as we already have millions of rows in the db.)
    On the main entity "Trans" we use: partition by range (month) on a date column.
    And on all @OneToMany we use: partition by reference (as they have a primary-foreign key relationship).
    But for the @OneToOne key for the referenced object, the key is placed in the main/source object as the example below:
    @Entity
    public class Employee {
    @Id
    @Column(name="EMP_ID")
    private long id;
    @OneToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ADDRESS_ID")
    private Address address;
    EMPLOYEE (table)
    EMP_ID FIRSTNAME LASTNAME SALARY ADDRESS_ID
    1 Bob Way 50000 6
    2 Sarah Smith 60000 7
    ADDRESS (table)
    ADDRESS_ID STREET CITY PROVINCE COUNTRY P_CODE
    6 17 Bank St Ottawa ON Canada K2H7Z5
    7 22 Main St Toronto ON Canada     L5H2D5
    From the Oracle documentation: "Reference partitioning allows the partitioning of two tables related to one another by referential constraints. The partitioning key is resolved through an existing parent-child relationship, enforced by enabled and active primary key and foreign key constraints."
    How can we use "partition by reference" on @OneToOne relationsships or are there other solutions?
    Thanks for any advice.
    /Mats

    Crospost! How to use Oracle partitioning with JPA @OneToOne reference?

  • How to Configure a oracle R12 with RAC on two different  system .

    I have one laptop and one desktop
    Laptop----
    on laptop I have install vmware 8
    Host OS --win7
    Guest OS---linux 4
    Desktop ---
    On Desktop I have install Vmware 8
    Hosts OS --- Win XP
    Guest OS ---Linux 4
    Plz suggest How configure oracle R12 with RAC using both system .

    Hussein Sawwan wrote:
    on laptop I have install vmware 8
    Host OS --win7
    Guest OS---linux 4
    Desktop ---
    On Desktop I have install Vmware 8
    Hosts OS --- Win XP
    Guest OS ---Linux 4
    Plz suggest How configure oracle R12 with RAC using both system .If you want to configure RAC, then you must have the same OS installed on all RAC nodes -- See (RAC: Frequently Asked Questions [ID 220970.1], Does Oracle Clusterware or Oracle Real Application Clusters support heterogeneous platforms?) for details.
    Once you have the same OS, please refer to:
    Oracle E-Business Suite Release 12 High Availability Documentation Roadmap [ID 1072636.1]
    Using Oracle 10g Release 2 Real Application Clusters and Automatic Storage Management with Oracle E-Business Suite Release 12 [ID 388577.1]
    Using Oracle 11g Release 2 Real Application Clusters with Oracle E-Business Suite Release 12 [ID 823587.1]
    Thanks,
    HusseinHi Hussein,
    For Rac I am using both same OS (linux 4) for both nodes .
    Plz suggest its possible to install two nodes on different machine(diiferent virtual machine on different system ) .Can communicate both machine without any problem if its possible plz provide links.

  • Column not found error while populatin a oracle table with ODI USer

    Hi,
    I am trying to populate a column in a oracle table with the ODI USER name using the function getUser("USER_NAME") in the Mapping column of the Interface, But the interface throwhing an error *Column not found : Supervisor in Statement [Select......]*. but it's working fine with getUser("I_USER') the column is populating the user identifier.
    can any one help me out why user is not populating.
    Thanks

    Enclose the call to the getUser api inside single quotes
    '<%=getUser("USER_NAME")%>'ID being a number can be used directly but USER_NAME returns a string that needs to be quoted

  • Uploading a file (.doc, .xls, .txt) into an Oracle table with BLOB column

    Hello All :
    I have been trying to figure out for a simple code I can use in my JSP to upload a file (of any format) into an Oracle table with a BLOB column type. I have gone through a lot of existing forums but couldnot find a simple code (that doesnot use Servlet, for eg.) to implement this piece.
    Thanks a lot for your help !!

    Hi.
    First of all to put a file into Oracle you need to get the array of bytes byte[] for that file. For this use for example FileInputStream.
    After you get the byte array try to use this code:
            try {
                Connection conn = myGetDBConnection();
                PreparedStatement pstmt = conn.prepareStatement("INSERT INTO table1 (content) VALUES(?)");
                byte[] content = myGetFileAsBytes();
                if (content != null) {
                    pstmt.setBinaryStream(0, new ByteArrayInputStream(content), content.length);
                pstmt.close();
                conn.close();
            } catch (Exception ex) {
                ex.printStackTrace();
            }or instead of using ByteArrayInputStream try pstmt.setBinaryStream(0, new FileInputStream(yourFile), getFileSize());Hope this will help...
    regards, Victor Letunovsky

  • Upload text file to oracle table with checking and aggregation

    Hi Friends,
    I am new to ODI.  I have encountered a problem which is specific to ODI 11G (11.1.1.6.3) to upload text file to oracle table with checking and aggregation.  Would you please teach me how to implement the following requirement in ODI 11G?
    Input text file a:
    staffCode, staffCat, status, data
    input text file b:
    staffCodeStart, staffCodeEnd, staffCat
    temp output oracle table c:
    staffCat, data
    output oracle table d:
    staffCat, data
    order:
    a.staffCode, a.staffCat, a.status
    filter:
    a.status = ‘active’
    join:
    a left outerjoin b on a.staffCode between b.staffCodeStart and b.staffCodeEnd
    insert temp table c:
    c.staffCat = if b.staffCat is not null then b.staffCat else a.staffCat
    c.data = a.data
    insert table d:
    if c.staffCat between 99 and 1000 then d.staffCat = c.staffCat, d.data = sum(c.data)
    else d.staffCat = c.staffCat, d.data = LAST(c.data)
    Any help on fixing this is highly appreciated. Thanks!!
    Thanks,
    Chris

    Dear Santy,
    Many thanks for your prompt reply.  May I have more information about the LAST or SUM step?
    I was successful to create and run the following interfaces p and q
    1. Drag text file a to a newly created interface panel p
    2. Filter text file a : a.status = ‘active’
    3. Lookup text file a to text file b : a.staffCode between b.staffCodeStart and b.staffCodeEnd
    4. Drag oracle temp table c to interface panel p
    5. Set c.staffCat : CASE WHEN b.staffCat IS NULL THEN a.staffCat ELSE b.staffCat END
    6. Set c.data : a.data
    7. Drag oracle temp table c to a newly created interface panel q
    8. Drag oracle table d to interface panel q
    9. Set UK to d.staffCat
    10. Set Distinct Rows to table d
    11. Set d.staffCat = c.staffCat
    12. Set d.data = SUM(c.data)
    However, the interface q should be more than that:
    If c.staffCat is between 99 and 1000, then d.data = the last record c.data; else d.data = sum(c.data)
    Would you please teach me how to do the LAST or SUM steps?  Moreover, can interface p and interface q be combined to one interface and do not use the temp table c?  Millions thanks!
    Regards,
    Chris

  • How to install Oracle 10g with its grid functionality on Linux?

    Well, I thought changing the subject line might help to convey the meaning of what I want better. Here's my earlier post from a few hours earlier.
    Hi,
    I need carry out TPC-C benchmarking test for Oracle 10g (using one, two and four servers; basically using the grid in case of multiple servers). I have installed oracle 10g (with default options) on all the four servers, but beyond that I have no idea as to how can I invoke the grid option in order to carry out the tests-by my statement, I mean do I need to choose grid option while installing Oracle or is it the case that I specify the grid option in the code that I write for carrying out the tests. The OS is LInux (Scientific Linux).
    An unrelated problem-one of the servers is 64 bit while others are 32 bit, and proper versions of oracle have been installed. Neglecting the obvious fact that this will make comparisons difficult does anyone anticipate any other problem?
    Many Thanks!
    Steve
    *******************************************************************************************************

    Do you think that the installation of RAC can be done
    in a week? yes, as long as you know what you are doing and can catch the concept quickly and good at following instructions.
    Moreover, we do not have a cluster-all we
    have are four servers that are separate. Do you know
    if the name Real Application Clusters implies that
    the servers have to be in a cluster?
    The basic idea of RAC is all these hosts need to share same set of storage. The most popular such storage are SAN and NAS.
    An example of building RAC on linux
    http://www.oracle.com/technology/pub/articles/hunter_rac10gr2_iscsi.html

  • To connect oracle database with ms access database

    i want to connect oracle database with ms access database
    i have follow the following steps
    1. create ms access database.
    2. create system dsn.
    3. make change in listener.ora.
    4. make change in hs folder.
    5.change the tnsname.ora.
    6. lsnrctl stop and lsnrct start.
    7. create database link in oracle sql*plus.
    8.select the table of ms access
    but i have return the foloowing error.
    ORA-12154: TNS:could not resolve the connect identifier specified
    using window 2000, oracle 10g

    Have a look on ths thread, may it helps ...
    Re: copy access data into oracle with form builder 9i

  • Best practice for integrating oracle atg with external web service

    Hi All
    What is the best practice for integrating oracle atg with external web service? Is it using integration repository or calling the web service directly from the java class using a WS client?
    With Thanks & Regards
    Abhishek

    Using Integration Repository might cause performance overhead based on the operation you are doing, I have never used Integration Repository for 3rd Party integration therefore I am not able to make any comment on this.
    Calling directly as a Java Client is an easy approach and you can use ATG component framework to support that by making the endpoint, security credentials etc as configurable properties.
    Cheers
    R
    Edited by: Rajeev_R on Apr 29, 2013 3:49 AM

  • Error when connecting an oracle DB with Integration gateway

    I followed the steps from the blog How to connect an Oracle DB with Integration Gateway in SMP3 and the ojdbc was deployed successfully to SMP. Still, i'm getting "Driver class oracle.jdbc.driver.OracleDriver not found" error message when i try to test my connection. The first difference i saw when completing these steps was that I'm using SMP3 SP05, could this be the issue?

    Joao D Franco Net
    Could you share below information:
    Can you cross check if deployed driver are OSGi enabled? Refer this.
    Can you share screenshot of the destination settings and error ?
    note: The blog you followed is referring to SP03 (1st GA of SMP3)..You should not have any problem in connecting to Oracle DB being on any SP.
    Regards,
    JK

Maybe you are looking for