Database connectivity in struts ( EJB) with Oracle 9

hi,
We are developing a Banking application using Struts & EJB, & I need to use Oracle 9 as a database. Could anyone please let me know, the professional way of connecting this application to the oracle database using Struts and EJB. A good example will help me a lot, so please give me example code also.
Thanks a lot in advance.
Raghav

Hello,
For keeping the standby database on same HOST....it does seems to be great...i must be on separate box....may be on different network...i believe you would be using it for some failiover purpose...Isn't it.
For Unix it is quite easy..you may implement like this...The Issue which you are referring may be because of wrong Oracle Home or SID....(i'm not very much sure..) You may try following steps:
1. Create a separate Unix A/c and set ORACLE_HOME and ORACLE_SID relevant to your StandBy Database. I believe the Home would be same whereas SID would be your standby databse.
2. Take a Cold Backup of All your database files from Production.
3. Copy these files on separate mount points for standby Db. Put them all to relevant directory and be sure to set the Group of all these files as "SYSDBA" This is Must.
4. And then modify your INIT.ORA file i.e. InitSID.ora file accordingly and put the file in ORACLE_HOME
5. Login to Newly created Unix A/c. Check whether ORACLE_SID is set ot not to your standby database instance.
6. Login to sys as sysdba and start up the database. It will by default would try to check & do for your relevant Oracle SID for this profile...
HTH
Regards,
Kamesh Rastogi

Similar Messages

  • Database connectivity in struts with mysql

    Hi,
    I want to database connectivity in struts with mysql in struts-config.xml file. I have give the code in struts-config.xml file is given below...................
    <data-sources>
    <data-source key="dbname" type="org.apache.commons.dbcp.BasicDataSource" >
    <set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
    <set-property property="url" value="jdbc:mysql://localhost:3306/antrowinnovation" />
    <!-- <set-property property="username" value=""/>
    <set-property property="password" value="indra" /> -->
    </data-source>
    </data-sources>
    And give the code in Action class is given below...
         int i=0;
         Connection con;
         Statement stmt;
              DataSource dataSource = (DataSource)servlet.getServletContext().getAttribute("dbname");
              System.out.println(dataSource);
         try{
              System.out.println("Database connecting....");
                   con=dataSource.getConnection();
              stmt=con.createStatement();
              System.out.println("Database connected....");
                   i=stmt.executeUpdate("insert into login values('" + username + "','" + password + "')");
                   System.out.println("Values inserted....");
                   }catch(Exception e){
                        System.out.println(e.getMessage());
                        System.out.println("Exception in try");
                        e.printStackTrace();
              return 0;
    But when i have run this then i got this Exception....
    INFO: Initialize action of type: login.LoginAction
    null
    Database connecting....
    null
    Exception in try
    java.lang.NullPointerException
         at login.LoginAction.insertUser(LoginAction.java:27)
         at login.LoginAction.execute(LoginAction.java:47)
         at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
         at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
         at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:743)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Plz help me..

    Read some Struts tutorial.

  • Steps to change universe database connection from SQL server to Oracle 10

    Hi,
    we are moving from sql server to Oracle 10.Please let me know the steps and various parameters I should consider while changing universe database connection from SQL server to Oracle 10.
    Following are the steps which I assumed :
    1.     create a new Oracle database connection or edit the existing connection to point to Oracle server
    2.     Need to check sql for each object, having integrity check for universe will solve the purpose of parsing each object
    3.     Exporting the universe after integrity check
    4.     Report data testing
    Let me know if I miss on any steps.Also what all factors I need to consider while moving to Oracle for eg: what @ custom sql,what @ table names,what @ LOV etc.
    Kindly reply

    Thanks Abhijeet and Shreyash,
    I will follow the steps you have suggested.
    Actually I was searching for this on net and got to know that with Oracle database connection,theres lot of stuff needs to take care of in terms of custom sql and LOV and in our case,we have lot of custom sql for each object in the universe so just wanted to confirm.
    I will do the changes and let you guys know in case theres any isuue specifically to Oracle.

  • Can we establish connection between developer 6i with oracle 10g

    hi all
    can some body guide me that how we establish connection between developer 6i with oracle 10g. i have install developer and oracle 10g on different machine
    please guide me

    Look at following thread
    Re: Patch 18 available for Windows Client/Server Forms 6i
    I had installed Patch 18 against 10G DB and Forms work well.
    Anyway you can see patches in
    http://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=4948577&release=3060000&plat_lang=912P
    Hope this helps
    Regards
    Rosario

  • Connecting to the BW with Oracle Warehouse Builder

    Hello,
    has anyone made experience in connecting to the BW with Oracle Warehouse Builder?
    It's a theoretic question, I would like to know if it's possible and how.
    thanks in advance
    Tobias

    There is an Oracle Warehouse Builder Integrator for SAP.
    Have a look at this link
    http://www.oracle.com/technology/products/warehouse/pdf/SAP_DataSheet.pdf
    Regards

  • Unable to connect Forms and Report with Oracle 9i database

    Dear All
    Please help
    I have received the following message when i connect Developer 10G Report builder with oracle 9i database.
    scott/tiger@z
    REP-0501:Unable to connect to the specified database ORA-12154:TNS could not resolve service name.
    I have written the following text in tnsnames.ora file.
    # TNSNAMES.ORA Network Configuration File: E:\ora_10g\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    z =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = zkhan-dfml)(PORT = 1521))
    (CONNECT_DATA =
    (SID = dba)
    One more thing that i need to mention,I have also installed Oracle Report 6i and its connecting well.I have installed Oracle database in my own computer.
    Regards

    [email protected] wrote:
    Thanks for the reply,Now my tnsnames.ora file is look like this.
    z =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = zkhan-dfml)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = dba)
    but still facing the same error ,one more thing that i need to mention, I have 3 Oracle home.details are:
    for Oracle database 9i
    for report builder 6i
    for Developer 10G
    Kindly advise.Yes, you definately needed to mention that. That suggests you also have 3 $ORACLE_HOME/network/admin directories, each with its own tnsnames.ora file. So you need to make sure you are hitting the correct one. I'd pick one to be the controlling one and set the TNS_ADMIN enviornment variable to point to it.

  • Unable to create a connection in data modeler with oracle 9i

    While creating a connection to my 9i db I am getting the following error
    Status : Failure -Test failed: oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/i18n/text/converter/CharacterConverter;

    Hi,
    This problem when importing from Data Dictionary can occur intermittently if you have the Oracle 9i or 10g database software installed on your computer.
    Ivan provided a workaround in a previous message in this forum Re: Error when testing database connection :
    Try to create a batch file (datamodeler.bat) under Data Modeler installation folder and put the following two lines in it:
    set ORACLE_HOME=%CD%
    start datamodeler.exe
    Then double click on this file to start Data Modeler.
    Ivan

  • Database connection encryption and integrity with ColdFusion and Oracle thin client

    As ColdFusion datasource we are using the Oracle thin client to  connect with the database. So, basically we are using a JDBC URL such as  jdbc:oracle:thin:@... and as Driver Class oracle.jdbc.OracleDriver. This works successfully however we would like to set encryption and  integrity parameters as well. In Java this is done similarly by setting a  Properties object prior to getting a connection as follows:
    Properties prop = new Properties();
    prop.put("oracle.net.encryption_client", "REQUIRED");
    prop.put("oracle.net.encryption_types_client", "( DES40 )");
    prop.put("oracle.net.crypto_checksum_client", "REQUESTED");
    prop.put("oracle.net.crypto_checksum_types_client", "( MD5 )");
    OracleDataSource ods = new OracleDataSource();
    ods.setProperties(prop);
    ods.setURL("jdbc:oracle:thin:@localhost:1521:main");
    Connection conn = ods.getConnection();
    Is there a way that I can pass these parameters to the ColdFusion  datasource. Ideally, I would love to do this centrally in such way that a  change to all the cfquery or cfstoredproc is not needed.
    I also know that in application servers such as Oracle AS there is an  option when creating a datasource which says "Add Properties". In there  you can add such properties. So, I was thinking of maybe creating a  JNDI DS in the app. server and then magically connecting to it but this  may have some impacts on the app.
    Besides this I was also thinking of communicating with the CF  datasource through the CF admin API (cfide.adminapi.administrator) and  also the option of extending the Oracle driver so that when CF connects  with it these params are already set.
    I would love to have your professional opinion and suggestions on this.

    I believe the thin driver actually needs the IP address (not the DNS name). Also, is "java" the name of the Oracle instance to which you are trying to connect?
    Try the following:String driver = "jdbc:oracle:thin";
    String dbIP = "W2RZ1NXG01's IP address";
    String dbPort = "1530";
    String dbSid = "java";
    String dbUser = "Admin";
    String dbPswd = "apassword";
    String cnctStr = driver + ":@" + dbIP + ":" + port + ":" + dbSid;
    try
        Class.forName("oracle.jdbc.driver.OracleDriver");
        con = DriverManager.getConnection( cnctStr, dbUser, dbPswd );
        stmt = con.createStatement();
        stmt.executeUpdate(createString);
        stmt.close();
        con.close();
    catch(SQLException ex)
        System.err.println( "The following SQLException occurred: " + ex );
        System.err.println( "Message: " + ex.getMessage() );

  • CONNECT SQL SERVER 2005 WITH Oracle 10.2.0.3

    Hi,
    I used URL http://www.databasejournal.com/features/oracle/article.php/10893_3442661_2 but its not working.
    I was reading note# 561033.1 adn planning to try.
    If any one done ,please let me know.

    user587327 wrote:
    its not working" is pretty vague. How about if you tell us
    1) What version of Oracle rdbms you are working with (ok, I see 10.2.0.3 in subject .. good)
    2) what OS it is running on (obviously SQL Server is on Windoze, but that doesn't mean that's where Oracle is) : Linux RHEL 4.4 64 bit
    3) what you are trying to do (get an Oracle database to retrieve data from SQL Server? vice versa? something else?):
    Connect to Oracle database and retrieve data from SQL SERVER 2005.So, you want the Oracle DB to act as a client to the SQL Server db?
    >
    4) what error code (ora-nnnnn or tns-00000) you are getting
    Showing
    SQL> desc spt_values@MYSQL
    ERROR:
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from MYSQL
    ----I've never used HSO to SQL Server, so I'm getting out of my area here. However ...
    I'm puzzled by the error msg referencing "Net8". Looks like an Oracle 8i construct but you said your db is 10.2. And since the box is Linux I wouldn't expect to find an old 8i installation lurking on it.
    I searched MetaLink (should be everyone's first resource when trying to understand an error message) for "ora-28545" and got 13 hits.
    >
    5) any other diagnostic messages you might have

  • Connecting to different servers with Oracle Rdb

    Hi,
    I have downloaded the Odbc-Driver driver for Rdb and made successful connections to my database server. The name of the server is hardcoded with the odbc administrator. How is it possible to use different servers from asp-script ?
    regards
    Martin

    I have done this, but the Driver (Oracle Rdb Driver, Version 3.00.02.04) do not understand the "DB"-Parameter correctly. The databasename is transferred to the server without the attach-command. So I can only make the connect to a preattached service. This is a known problem by Oracle.

  • Connection problem for d2k with oracle 9i

    Hi,
    GoodDay, This is Ramesh. I have loaded the D2K as well as the Oracle 9i to my Windows-XP OS.But whenever i am trying to connect the database through D2K it is not being possible.After giving the user name & password it is showing error message like "TNS Error". Can anyone help me out with the process of connection??
    Regards,
    Ramesh.

    You gave only user name and password, no database string? (hint: the tnsnames.ora file in your Dev2K install should point to the database, which happens to be on the same machine)
    Which TNS Error? There are hundreds if not thousands of TNS error messages.

  • Struts along with Oracle Application Server 10.1.3...class not found.......

    Hi,
    I have deployed an ear file.
    It throws following exceptions. Can any one help me?
    500 Internal Server Error
    oracle.classloader.util.AnnotatedNoClassDefFoundError:
    Missing class: org.apache.struts.action.Action
    Dependent class: com.ats.swdms.metadata.frontaction.CreateBinAction
    Loader: test4.root:0.0.0
    Code-Source: /D:/product/10.1.3/OracleAS_1/j2ee/home/applications/test4/swdmsUtilrel1_0.jar
    Configuration: manifest of /D:/product/10.1.3/OracleAS_1/j2ee/home/applications/test4/swdmsEJBrel1_0.jar
    The missing class is available from the following locations:
    1. Code-Source: /D:/product/10.1.3/OracleAS_1/j2ee/home/applications/test4/swdmsWARrel1_0/WEB-INF/lib/struts.jar (from WEB-INF/lib/ directory in D:\product\10.1.3\OracleAS_1\j2ee\home\applications\test4\swdmsWARrel1_0\WEB-INF\lib)
    This code-source is available in loader test4.web.swdmsWARrel1_0:0.0.0. This is a child of the dependent loader test4.root:0.0.0.
    2. Code-Source: /D:/product/10.1.3/OracleAS_1/j2ee/home/applications/tes12/struts.jar (from manifest of /D:/product/10.1.3/OracleAS_1/j2ee/home/applications/tes12/swdmsWARrel1_0/)
    This code-source is available in loader tes12.web.swdmsWARrel1_0:0.0.0.
    at oracle.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2247)
    at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1457)
    at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
    at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
    at oracle.classloader.SearchPolicy.loadClass(SearchPolicy.java:642)
    at oracle.classloader.PolicyClassLoader.askParentForClass(PolicyClassLoader.java:1284)
    at oracle.classloader.SearchPolicy$AskParent.getClass(SearchPolicy.java:69)
    at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
    at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1660)
    at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1621)
    at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1606)
    at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:119)
    at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:145)
    at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:282)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:220)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    Regards,
    [email protected]

    Hello,
    It looks like your application (test4) does not contains the struts libraries.
    You have it deployed in a different application tes12.
    Can you check that it is the fact and then creata a shared library or packahe it with the test4 application
    Regards
    Tugdual Grall

  • Connect to SQL Server with Oracle SQL Developer

    Hi,
    I am unable to connect to a named instance (Enigma\Enigma) on my local machine using sql developer. Every time I try to connect it says Cannot connect to Microsoft SQL Server on Enigma.
    Somebody please assist.

    Have you tried it on Forum : SQL Developer
    SQL Developer

  • Pls give me example of Java Servlet with Oracle

    Hi Guys,
    I am new to Database connectivity of JAVA Servlet with Oracle.
    So can you give me one complete example of connecting Java Servlet with Oracle 9i database.
    [ i mean Select statement, Insert statement..]
    I have tomcat server which comes built-in with NetBeans IDE.
    I need this because, i always come accross messages saying that " you need to change classpath this way " , or " you need to write connection this way "....
    So to avoid all this wrong things..i need your help.
    You guys can reply me on [email protected]
    Thanks & Appreciate..
    Dal Hit

    I got succeeded!
    I changed the three point:
    * add 'package hoo;' in HelloBean.java
    * add '<%@ page import="my.HelloBean" %>' in hello3.jsp
    * change '<jsp:useBean id="hello" class="HelloBean">
    to '<jsp:useBean id="hello" class="my.HelloBean">
    Before posting, I searched google three times but couldn't get answer.
    I could not get well if you didn't give me help...
    Thank you very much.

  • Help for getting connection with oracle database

    Hello,
    i have a problem to connect my java program with oracle databse.
    i have oracle 8 release. i tried all my best to connect but i
    can't. please help me. whenever i compile JdbcCheckup.java file
    which is distributed with oracle 8 release, it compile successfully.
    but whenever i run JdbcCheckup class file then it will generate an
    exception and that is -
    Exception in thread "main" java.lang.ClassNotFoundException:
    oracle.jdbc.driver.OracleDriver
         at java.lang.class.forname0(native method)
         at java.lang.class.forname(unknown source)
    and some other error message.
    But, by following yours given instruction, first, i unzip CLASSES111.zip
    in file which is distributed with oracle 8 realease in jdbc subdirectory
    into c:\temp directory and then run oracle installer(setup.exe) and point
    the installer to c:\temp and then i install the oracle JDBC drivers(beta)
    7.3.3.1.3 from the jdbc subfolder into oracle installer by selecting
    win95.prd for jdbc subfolder.
    After that i write into my autoexec.bat file,
    path d:\jdk\lib;d:\jdk\bin;c:\windows\command;C:\temp\BIN;c:\temp\jdbc\lib\classes111.zip
    and then i restart the machine and the i complile and run JdbcCheckup file
    But, i can't recognize my error to define class path or installing the
    driver. please help me in details so that i overcome this problem.
    because i am student of B.sc. in CIS of final year. i need to submit
    my project within some days. please reply me as early as possible.
    thanks
    hemonto
    email - [email protected]

    path d:\jdk\lib;d:\jdk\bin;c:\windows\command;C:\temp\BIN;c:\temp\jdbc\lib\classes111.zipYou've added classes111.zip to your PATH, not your CLASSPATH.
    Add it to your CLASSPATH using:
    set CLASSPATH=%CLASSPATH%;c:\temp\jdbc\lib\classes111.zip
    then try to compile/run again.

Maybe you are looking for