Connecting database in Servlet vs App

Hi,
Windows 2000 Server / SQL Server 2000 / Tomcat
I have a class managing the connections and requests to databases.
When invoking it from a java app context (launched from the command line java myApp), it's working fine
but when the same connection is made from a servlet, the Class.forName(dbDriver) doesn't work. I don't have a specific messsage, the Exception e.getMessage() returns only the driver used to access the database.
Have any idea ?

here is the test I made, creating a servlet as simple as possible :
public void doGet(HttpServletRequest requete, HttpServletResponse response) throws IOException, ServletException{
test( response );
public void test(HttpServletResponse response){
boolean correct = true;
PrintWriter pw = null;
try{
response.setContentType( "text/html" );
pw = response.getWriter();
catch(Exception e){ correct = false;}
if ( correct ){
try{
Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver" ).newInstance();
catch( Exception e ){
pw.println( "Error : " + e.getMessage() );
the Class.forName send me in the Exception.
The message is Error : com.microsoft.jdbc.sqlserver.SQLServerDriver
I'm running Windows 2000 Server, SQL Server 2000, Microsoft SQL Server 2000 Driver for JDBC, Tomcat 5.5, JRE 1.5.0
The same Class.forName is ok when called from the main of a java App.

Similar Messages

  • Connecting database in servlet

    I am trying to connect to the database in a servlet but it throws a ClassNotFoundException.
    the problem is when i am trying with the same piece of code in a simple java class. it works perfectly fine.
    Server i am using is - Jakarta-Tomcat 5.
    driver - com.microsoft.sqlserverdriver.SQLServerDriver.
    all the packages imported are also the same..
    Can any one suggest a solution to this...

    Did you put the sqlsever jdbc jars in WEB-INF/lib, or is it on Tomcat's classpath?

  • Connecting database to Servlets

    Hi i am trying to connect MySql to a simple servlet program. The MySql server gets started and the tables and data are retrievable, and the servlet is compiled, but unable to run the servlet in the browser. I get a blank page when i run the program in the browser.
    I have set all the classpaths right, and have mapped the class file in the web.xml. This is my servlet program:
    import java.io.*;
    import java.lang.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class servsql extends HttpServlet
            public void doGet(HttpServletRequest req, HttpServletResponse res) throw
    s ServletException,IOException
                    Connection con=null;
                    Statement stat=null;
                    ResultSet rs=null;
                    String username="root";
                    String password="tellno11";
                    String url="jdbc:mysql://127.0.0.1/goldendb";
                    try{
                    Class.forName("com.mysql.jdbc.Driver").newInstance();
                    con=DriverManager.getConnection(url,username,password);
                    stat=con.createStatement();
                    rs=stat.executeQuery("select * from emp");
              res.setContentType("text/html");
                    PrintWriter out= res.getWriter();
                    while (rs.next())
                    out.println("<html>");
                    out.println("<head><title>First SQL Program</title></head>");
                    out.println("<body>rs.getString(1)</body>");
                    out.println("</html>");
                   } catch(Exception e) {  }
    }Any suggestions of how to fix the problem?
    Thanks,
    Nive

    Hi i am trying to connect MySql to a simple servlet
    program. The MySql server gets started and the tables
    and data are retrievable, and the servlet is
    compiled, but unable to run the servlet in the
    browser. I get a blank page when i run the program in
    the browser.
    I have set all the classpaths right, and have mapped
    the class file in the web.xml. This is my servlet
    program:
    import java.io.*;
    import java.lang.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class servsql extends HttpServlet
    public void doGet(HttpServletRequest req,
    est req, HttpServletResponse res) throw
    s ServletException,IOException
    Connection con=null;
    Statement stat=null;
    ResultSet rs=null;
    String username="root";
    String password="tellno11";
    String
    String
    String url="jdbc:mysql://127.0.0.1/goldendb";
    try{
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    con=DriverManager.getConnection(url,username,password
    stat=con.createStatement();
    rs=stat.executeQuery("select * from
    y("select * from emp");
              res.setContentType("text/html");
    PrintWriter out= res.getWriter();
    while (rs.next())
    out.println("<html>");
    out.println("<head><title>First SQL
    <title>First SQL Program</title></head>");
    out.println("<body>rs.getString(1)</body>");
    out.println("</html>");
    } catch(Exception e) {  }Put a print statement inside the bracket to print the exception like
    System.out.println(e);
    and check whether there is any exception or not
    >
    regards
    shanu

  • Connecting to MySQL Database with Servlet

    Hi All,
    I want to connect to MySQL Database from servlet.
    I am using Tomcat websever 3.3.1, where i have to set classpath of mysql jdbc driver.
    I tried by copying mysql jdbc driver in so many directiories of Tomcat server but it is
    giving me error like "no specified driver find"
    So please send me all the solutions and how to set the classpath to connect to
    mysql database.
    Thanks

    U r correct that so many people are giving me solutions but that are not working for me
    I think i not correct in setting the classapath to mysql jdbc driver.
    1)I have unjarred correctly and all the classes are present in that.
    yes driver class is there in that .
    2)Now i am using new version of the mysqljdbc that is 2.0.13
    If now any driver after this send me url i will download it and use it
    3)I am unable to under stand what is yourcontext in
    yourcontext/web-inf/lib?
    This is my directory structure.
    c:tomcat in this i have
    bin
    conf
    doc
    lib
    logs
    modules
    native
    webapps
    work
    in bin there are no subdirectories
    in conf i have
    auto,jserv,jk,users
    in doc i have
    appdev,images
    sample( in appdev)
    etc,lib,src,web(in sample)
    images(in sample\web)
    in lib i have
    apps
    common
    container(c:\tomcat\lib)
    in logs,modules there are no subdirectories
    in native (c:\tomcat\native) i have
    mod_jk
    mod_jserv
    in mod_jk i have
    apache 1.3
    common
    iis
    jni
    netscape
    nt_service
    in webapps i have (c:tomcat\webapps)
    Admin,Examples,root
    in Admin i have (c:\tomcat\webapps\admin)
    contextadmin
    Meta-inf
    Test
    Web-inf
    in web-inf (c:\tomcat\webapps\admin\web-inf)
    Classes,lib,script
    in classes i have (c:\tomcat\webapps\admin\web-inf\classes)
    tadm
    in examples (c:\tomcat\webapps\examples) i have
    Images,Jsp,Meta-inf,Servlets,Web-inf
    in web-inf (c:\tomcat\webapps\examples\web-inf) i have
         Classes,jsp
    in classed (c:\tomcat\webapps\examplesweb-inf\classes) i have
    Cal
    Checkbox
    Colors
    Dates
    Error
    Examples
    Num
    Sessions
    in jsp (c:\tomcat\webapps\examples\web-inf\jsp) i have
    applet          
    I think this is enough to give correct answer for me .
    Thanks

  • Cannot connect to database with servlet thru apache http server / vhosts

    Hello,
    I have an application that works perfectly when Tomcat 5.5 is running stand-alone, but when I run Tomcat and Apache HTTP Server together, I get an error when trying to connect to the database. Servlets are working fine otherwise. Connection pooling is setup and working fine for Tomcat stand-alone. With the Apache server, I'm running Virtual Hosts.
    My guess is that I need something in the host block of server.xml about the context.xml where the db resource pool is defined. This is what I have so far in server.xml:
    <Host name="www.mydomain.com" debug="0" appBase="d:/WebApps/mydomain"
    unpackWARs="true" autoDeploy="true">
    <Context path="" docBase="" debug="0"/>
    </Host>
    Or the problem may be caused by something else entirely. Does anybody have any suggestions? Your help is greatly appreciated.
    Thank you,
    Logan

    A little help? Anybody?
    I can connect to the database with Tomcat stand-alone, but not with Tomcat integrated with Apache. I have seen this problem described elsewhere, but no solution has been found.

  • HELP IN DATABASE CONNECTIVITY IN A SERVLET`

    HI there,
    I have some issues in an application. I have a servlet which is called Servlet1.class. I have deployed this in my tomcat webapps folder. There is a stand alone application called MailAgent.class which pools into a mail box and retrieves the messages and converts them as HTTP messages. Then the MailAgent.class sends the HTTP message as multipart post (email message) to the servlet. In the servlet I am trying to establish a database connection with the JDBC driver from third party vendor. I am unable to get the driver class when I establish the connection with the database. Is there any issues with servlet and database access. I am able to connect if I run as a stand alone application.
    Any help would be greatly appreciated.
    Thanks
    John

    There shouldn't be any .class file in your webapps folder. I hope you mean that you created a subdirectory under webapps, with a WEB-INF under that and /classes and /lib under that. Your servlet .class file and its package directory structure belong under webapps/yourApp/WEB-INF/classes, right?
    You can create database connections in a servlet, although I agree with the previous poster that you'd be better off putting database code into objects that you could test off-line, without the servlet.
    You've got to have the JDBC driver JARs in the webapps/yourApp/WEB-INF/lib directory, for starters.
    If you get really adventurous you can create a pooled JNDI data source, but maybe that's another day's work. Get the basic connection working first.

  • Connection to the Database thru Servlet

    Hello:
    I have just read some threads in this forum and noticed that people saying that connecting to the database in JSP is not a good Java Programming Habit. So, could you please give a little guidance on connection to the Oracle database in servlet. Thank you very much.
    Oscar.

    You use standard JDBC:
    http://java.sun.com/docs/books/tutorial/jdbc/index.htmlIn a servlet container, most of the time, you set up a connection pool that you access through JNDI
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.htmlFor larger applications you might want to use "Data Access Objects"
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.htmlCheers,
    evnafets

  • Using JDO in a Servlet container/app server

    Hi,
    I was just wondering what Solarmetric recommends when using Kodo in a
    servlet container/app server. Specifically the following:
    1. Should each user session maintain a PersistenceManager or should the
    PM be created per request? I am thinking it might be expensive to
    maintain PMs across requests since you may have idle sessions and the
    PMs may hold database resources? But since PMs aren't pooled in Kodo is
    creating/closing a PM per request expensive or is it offset by Kodo's
    connection pooling?
    2. Is it advisable to store data to be displayed on a JSP by storing the
    JDO instances themselves or serializable proxies (simple data beans) of
    these objects in a user's session?
    3. If you can store the JDO instances in the session, do you need to
    make them transient instances using makeTransient() and call close() the
    PersistenceManager?
    Thanks in advance,
    Khamsouk

    These are all very good questions. There really is no one right answer to any
    of them, so I'll just try to educate you on the issues involved and you can
    make your own decision. Hopefully other people who are actually using Kodo
    in a servlet/JSP environment will chime in too.
    1. Should each user session maintain a PersistenceManager or should the
    PM be created per request? I am thinking it might be expensive to
    maintain PMs across requests since you may have idle sessions and the
    PMs may hold database resources? But since PMs aren't pooled in Kodo is
    creating/closing a PM per request expensive or is it offset by Kodo's
    connection pooling?As long as you are outside of a datastore transaction, a PM does not maintain
    any database resources. The only significant state it maintains is a soft
    cache of persistent objects that have already been instantiated. If you are
    using Kodo 2.3 RC1 and have no set the
    com.solarmetric.kodo.DefaultFetchThreshold property to -1, then some
    large collections you obtain from query results or relation traversals may be
    scrollable result sets on the back-end, in which case they obviously maintain
    some database resources.
    2. Is it advisable to store data to be displayed on a JSP by storing the
    JDO instances themselves or serializable proxies (simple data beans) of
    these objects in a user's session?
    3. If you can store the JDO instances in the session, do you need to
    make them transient instances using makeTransient() and call close() the
    PersistenceManager?I'll address these together. JDO fully supports serialization, and in fact
    I think you'll find it does so in exactly the way that you want. If you choose
    to store serialized persistent objects in the session, then during
    serialization the objects will transparently pull in all of their persistent
    state and relations, so the entire object graph is serialized. When you
    deserialize, the objects will no longer be attached to their persistence
    manager -- they will be transient.
    Another options is to store the object IDs in the session, and re-retrieve
    the persistent objects for each web request.
    One design pattern that can probably net very good performance is to maintain
    a global read-only persistence manager that you use to dereference these IDs.
    Of course, if you ever want to change an object, you'll have to re-fetch it
    in a new persistence manager, and evict it from the global manager's cache.
    I hope this helps.

  • ALC-TTN-105-000 could not connect to bootstrap servlet

    hi i am trying to install livecycle server using Adobe LiveCycle Configuration Manager on windows 7.in this i reached to a slide heading is LifeCycle ES3 Database initialization there is a button labeled as initializa and two text field in host text field i entered localhost and in port i entered 8080 and getting error
    ALC-TTN-105-000 could not connect to bootstrap servlet.Port[Connection refused:connect] may be invalid .
    i tried other ports also 8081 8085 9090 etc but still facing the same error .can any one please tell how to resolve this error??please help i am a beginner and i am very excited to create my first app please help how to proceed further and resolve this issue!!

    sorry, the discription was not clear. I would like to replenish this. This scene was to initialize the LiveCycle ES2 database and with the host: localhost and the HTTP port: 8080
    And I tried to start the jboss and found out, there is no directory of the jboss under /opt/jboss.
    thanks

  • Failed to open the connection - database vendor code 17

    I'm upgrading a VB.net Windows Forms application from 1.1 to 4.0.  In the reporting form, the list of reports you can choose are pulled from a folder where the .rpt files reside.  Once the user chooses a report and executes it, vb code populates the current database connection information and displays the report in the report viewer control.
    The following things are true:
    - Version 1.1 works on my systems and my customers systems
    - The code has not been changed, except that it now targets .Net 4.0 instead of 1.1
    - The exact same .rpt files are being used
    - Version 4.0 connects to the same database my customer is using, and I can run the reports just fine from here.
    - Version 4.0 is able to connect to the database just fine from my customers systems (using the same connection information provided to the report)
    - My customer installed this:  http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_32bit_13_0_2.zip
    The only problem is that my customer encounters this error when trying to run any report from his systems:
    Failed to open the connection.
    Details:  Database Vendor Code: 17
    Failed to open the connection.
    Orders.BOL.TaskDetail {393C9017-0ED1-4E1E-8824-E222F4B9D14C}.rpt
    Details:  Database Vendor Code: 17
    I read all of the articles I could find, and they either don't describe this exact situation, or there is insufficient information for troubleshooting this issue.  Are there steps that I've missed to make Crystal Reports for VS2010 work on my customer's systems?
    Your help is appreciated,
    Mark

    Hi Mark,
    More information required -
    - Does this happen with all reports or few?
    - What is the connection type used for the report to connect to the database (OLEDB,ODBC etc)
    - Are you changing the database at runtime?
    few things you could check
    - Check if the database is accaessible from the client machine with proper permissions / rights.
    - If its an ODBC connection check if the DSN with same name is created on the client machine.
    - Check the driver / provided used by the report to connect to the DB, verify that the same is installed on the client machine. (SQL NAtive client, SQL Server etc)
    Also take a look at below articles discussing the simillar issue.
    [CR for VS2010: Failed to Open Connection [Database Vendor Code: 17 ]|CR for VS2010: Failed to Open Connection [Database Vendor Code: 17 ]]
    [1474461 - Unknown Database Connector Error when connecting to a Dataset in a VS .NET application |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333433373334333433363331%7D.do]
    Hope this helps,
    - Bhushan.

  • I am getting error while connecting to sqlplus by using apps account in 11i

    i am getting error while connecting to sqlplus by using apps account in 11i. Does anyone has similar error.
    [applmgr@appsc05t01 admin]$ sqlplus
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Sep 13 14:34:52 2010
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter user-name: apps
    ERROR:
    ORA-12514: Message 12514 not found; product=RDBMS; facility=ORA
    Enter user-name:
    Thanks
    Rao

    yes.
    login as: gorantla
    [email protected]'s password:
    Last login: Mon Sep 13 14:39:23 2010 from glng3wy9g1.actuant.pri
    [gorantla@appsc05t01 ~]$ sudo su - applmgr
    [applmgr@appsc05t01 ~]$ ora_setup
    Available databases:
    x = ATUXX
    y = ATUYY
    z = ATUZZ
    Select database: \c
    y
    ORACLE_SID=ATUYY
    IAS_ORACLE_HOME=/apps/ATUYY/atuyyora/iAS
    ORACLE_HOME=/apps/ATUYY/atuyyora/8.0.6
    APPL_TOP=/apps/ATUYY/atuyyappl
    [applmgr@appsc05t01 ~]$
    [applmgr@appsc05t01 ~]$
    [applmgr@appsc05t01 ~]$
    [applmgr@appsc05t01 ~]$ tnsping ATUYY
    TNS Ping Utility for Linux: Version 8.0.6.3.0 - Production on 13-SEP-2010 15:42:32
    (c) Copyright 1997 Oracle Corporation. All rights reserved.
    Attempting to contact (ADDRESS=(PROTOCOL=tcp)(HOST=dbrac05t01-vip.actuant.pri)(PORT=1611))
    OK (0 msec)
    [applmgr@appsc05t01 ~]$ sqlplus
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Sep 13 15:42:40 2010
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter user-name: apps
    ERROR:
    ORA-12514: Message 12514 not found; product=RDBMS; facility=ORA
    Enter user-name:
    Thanks
    Rao

  • RC-00118: Error occurred during creation of database Raised by oracle.apps.

    Hi Experts,
    Please note i am doing the clonning from production to test server.
    Production Server -
    1. Run the adpreclone.pl on the apps & db tier.
    2. run the autoconfig on the apps and db tier.
    3. shut down the production instance.
    4. Moved the files and started the clonning process on the db tier i am getting the below issue.
    My current E-Business Suit Version is R12.0.4 Database Version is 10.2.0.3. Operating system is SUN SPARC 64 BIT SUN SOLARIS 10.
    Executing CreateDB...
    ADX Database Utility
    getConnectionUsingAppsJDBCConnector() -->
    APPS_JDBC_URL='null'
    Trying to get connection using SID based connect descriptor
    getConnection() -->
    sDbHost : proddb
    sDbDomain : clientdomain
    sDbPort : 1530
    sDbSid : TEST
    sDbUser : APPS
    Trying to connect using SID...
    getConnectionUsingSID() -->
    JDBC URL: jdbc:oracle:thin:@proddb.clientdomain:1530:TEST
    Exception occurred: java.sql.SQLException: ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SVR4 Error: 2: No such file or directory
    Trying to connect using SID as ServiceName
    getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=proddb.clientdomain)(PORT=1530))(CONNECT_DATA=(SERVICE_NAME=TEST)))
    Exception occurred: java.sql.SQLException: ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SVR4 Error: 2: No such file or directory
    Trying to connect using SID as ServiceName.DomainName
    getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=proddb.clientdomain)(PORT=1530))(CONNECT_DATA=(SERVICE_NAME=TEST.clientdomain)))
    Exception occurred: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
    The Connection descriptor used by the client was:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=proddb.clientdomain)(PORT=1530))(CONNECT_DATA=(SERVICE_NAME=TEST.clientdomain)))
    Connection could not be obtained; returning null
    -------------------ADX Database Utility Finished---------------
    adcrdb.sh started at Wed Mar 21 18:09:54 WAT 2012
    The environment settings are as follows ...
    ORACLE_HOME : /erptestdata2/u01/d01/tech_st/10.2.0
    ORACLE_SID : TEST
    TWO_TASK :
    PATH : /erptestdata2/u01/d01/tech_st/10.2.0/perl/bin:/erptestdata2/u01/d01/tech_st/10.2.0/bin:/usr/ccs/bin:/usr/sbin:/erptestdata2/u01/d01/tech_st/10.2.0/appsutil/jre/bin:/erptestdata2/u01/d01/tech_st/10.2.0/appsutil/clone/bin/../jre/bin:/erptestdata2/u01/d01/tech_st/10.2.0/appsutil/clone/bin/../jre/bin:/usr/sbin:/usr/bin:/opt/EMCpower/bin:/etc/emc/bin:/etc:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,SPARC-Enterprise/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin
    LD_LIBRARY_PATH : /erptestdata2/u01/d01/tech_st/10.2.0/lib:/usr/dt/lib:/usr/openwin/lib:/erptestdata2/u01/d01/tech_st/10.2.0/ctx/lib:/erptestdata2/u01/d01/tech_st/10.2.0/lib32
    Executable : /erptestdata2/u01/d01/tech_st/10.2.0/bin/sqlplus
    The log information will be written to
         /erptestdata2/u01/d01/tech_st/10.2.0/appsutil/log/TEST_proddb/adcrdb_TEST.txt
    Creating the control file for TEST_proddb database ...
    SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 21 18:09:54 2012
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected to an idle instance.
    ORACLE instance shut down.
    Connected to an idle instance.
    ORACLE instance started.
    Total System Global Area 1073741824 bytes
    Fixed Size          2035496 bytes
    Variable Size          432017624 bytes
    Database Buffers     624951296 bytes
    Redo Buffers          14737408 bytes
    CREATE CONTROLFILE REUSE SET DATABASE "TEST"
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01167: two files are the same file/group number or the same file
    ORA-01110: data file 31: '/erptestdata2/u01/d01/apps_st/data/olap.dbf'
    ORA-01110: data file 31: '/erptestdata2/u01/d01/apps_st/data/odm.dbf'
    alter database open resetlogs
    ERROR at line 1:
    ORA-01507: database not mounted
    alter tablespace TEMP1 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp01.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    alter tablespace TEMP1 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp02.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    alter tablespace TEMP2 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp03.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    alter tablespace TEMP2 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp04.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    alter tablespace TEMP1 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp10a5.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    ALTER DATABASE RENAME GLOBAL_NAME TO "TEST.clientdomain"
    ERROR at line 1:
    ORA-01109: database not open
    ORA-01507: database not mounted
    ORACLE instance shut down.
    Connected to an idle instance.
    ORACLE instance started.
    Total System Global Area 1073741824 bytes
    Fixed Size          2035496 bytes
    Variable Size          432017624 bytes
    Database Buffers     624951296 bytes
    Redo Buffers          14737408 bytes
    ORA-00205: error in identifying control file, check alert log for more info
    BEGIN dbms_backup_restore.zeroDbid(0); END;
    ERROR at line 1:
    ORA-00210: cannot open the specified control file
    ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 4168
    ORA-06512: at line 1
    ORACLE instance shut down.
    Connected to an idle instance.
    ORACLE instance started.
    Total System Global Area 1073741824 bytes
    Fixed Size          2035496 bytes
    Variable Size          432017624 bytes
    Database Buffers     624951296 bytes
    Redo Buffers          14737408 bytes
    CREATE CONTROLFILE REUSE SET DATABASE "TEST"
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01167: two files are the same file/group number or the same file
    ORA-01110: data file 31: '/erptestdata2/u01/d01/apps_st/data/olap.dbf'
    ORA-01110: data file 31: '/erptestdata2/u01/d01/apps_st/data/odm.dbf'
    alter database open resetlogs
    ERROR at line 1:
    ORA-01507: database not mounted
    alter tablespace TEMP1 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp01.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    alter tablespace TEMP1 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp02.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    alter tablespace TEMP2 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp03.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    alter tablespace TEMP2 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp04.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    alter tablespace TEMP1 add tempfile '/erptestdata2/u01/d01/apps_st/data/temp10a5.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    ALTER DATABASE RENAME GLOBAL_NAME TO "TEST.clientdomain"
    ERROR at line 1:
    ORA-01109: database not open
    Error Running create/replace library with adupdlib.sql
    ORA-01109: database not open
    PL/SQL procedure successfully completed.
    File created.
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    exit_code=0
    Checking for errors ...
    The database has not been successfully created. Shutting down the instance ...
    SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 21 18:10:16 2012
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected.
    ORACLE instance shut down.
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    .end std out.
    .end err out.
    ADX Database Utility
    getConnectionUsingAppsJDBCConnector() -->
    APPS_JDBC_URL='null'
    Trying to get connection using SID based connect descriptor
    getConnection() -->
    sDbHost : proddb
    sDbDomain : clientdomain
    sDbPort : 1530
    sDbSid : TEST
    sDbUser : APPS
    Trying to connect using SID...
    getConnectionUsingSID() -->
    JDBC URL: jdbc:oracle:thin:@proddb.clientdomain:1530:TEST
    Exception occurred: java.sql.SQLException: ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SVR4 Error: 2: No such file or directory
    Trying to connect using SID as ServiceName
    getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=proddb.clientdomain)(PORT=1530))(CONNECT_DATA=(SERVICE_NAME=TEST)))
    Exception occurred: java.sql.SQLException: ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SVR4 Error: 2: No such file or directory
    Trying to connect using SID as ServiceName.DomainName
    getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=proddb.clientdomain)(PORT=1530))(CONNECT_DATA=(SERVICE_NAME=TEST.clientdomain)))
    Exception occurred: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
    The Connection descriptor used by the client was:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=proddb.clientdomain)(PORT=1530))(CONNECT_DATA=(SERVICE_NAME=TEST.clientdomain)))
    Connection could not be obtained; returning null
    -------------------ADX Database Utility Finished---------------
    RC-00118: Error occurred during creation of database
    Raised by oracle.apps.ad.clone.ApplyDatabase
    Please advise ASAP.
    Regards
    Mohammed.

    Nikki,
    Check alert<SID>.log file for more details about the error.
    It looks like that the source database was not cleanly shutdown before copying the files to the target node. Please do the following and check then:
    SQL> connect / as sysdba
    SQL> startup mount;
    SQL> recover database using backup controlfile until cancel;
    -- type CANCEL
    SQL> alter database open resetlogs; If the above does not help, then shutdown the source database normally (make sure it is down), re-copy the files and start the cloning process again.

  • Not able to connect database from another os user using externally?

    Hi,
    I want to connect database from another os user. i am able to connect database from oracle externally. but not able to connect different OS user.
    As ORACLE User:
    [oracle@test1 admin]$ sqlplus /
    SQL*Plus: Release 11.2.0.2.0 Production on Mon Jan 16 19:41:57 2012
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    Non ORACLE user:
    [sample@test1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/
    [sample@test1 ~]$ export ORACLE_SID=rman
    [sample@test1 ~]$ export PATH=$ORACLE_HOME/bin:$PATH
    [sample@test1 ~]$ sqlplus /
    SQL*Plus: Release 11.2.0.2.0 Production on Mon Jan 16 19:37:42 2012
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    Process ID: 0
    Session ID: 0 Serial number: 0
    Enter user-name:
    Thanks

    You didn't install Oracle correctly, especially you didn't run the root.sh and rootpre.sh scripts.
    If you would have read the error message at all, and researched it, you would have known this.
    Regrettably however you decided to ignore Forums Etiquette and to abuse this forum with Yet Another Doc Question.
    Sybrand Bakker
    Senior Oracle DBA

  • Unable to connect database by DataSource in tomcat5.5 plz help to me

    hi,
    i want to connect Database through DataSource in Tomcat5.5 with mysql
    i wrote one servlet , made change in server.xml, web.xml.
    when i access it show exception
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.org.apache.tomcat.dbcp.collections)
            at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
            at java.security.AccessController.checkPermission(AccessController.java:427)
            at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
            at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)The servlet
    * DataSourceAccess.java
    * Created on August 22, 2005, 3:14 PM
    package officecom;
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.sql.*;
    * @author Paramasivam
    * @version
    public class DataSourceAccess extends HttpServlet {
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            /* TODO output your page here
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet DataSourceAccess</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Servlet DataSourceAccess at " + request.getContextPath () + "</h1>");
            out.println("</body>");
            out.println("</html>");
            out.println(" got connection ?  "+getDataConnnecion());
            out.close();
        public boolean getDataConnnecion(){
            try{
                System.out.println(" INFO : getConnection called     ");
                Context initContext = new InitialContext();
                Context envContext  = (Context)initContext.lookup("java:/comp/env");
                DataSource ds = (DataSource)envContext.lookup("mysql");
                Connection con = ds.getConnection();
                if( con != null ){
                    return true;
                }else
                    return false;
            }catch(Exception e){
                e.printStackTrace();
                return false;
        // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Returns a short description of the servlet.
        public String getServletInfo() {
            return "Short description";
        // </editor-fold>
    }Changes in server.xml
    <GlobalNamingResources>
          <Resource
          name="mysql"
          auth="Container"
          type="javax.sql.DataSource"
          password=""
          driverClassName="com.mysql.jdbc.Driver"
          maxIdle="2"
          maxWait="5000"
          username="root"
          url="jdbc:mysql://localhost:3306/sushi?autoReconnect=true"
          maxActive="4"/>
      </GlobalNamingResources>changes in web.xml
      <resource-ref>
               <description>Tomcat DBCP</description>
               <res-ref-name>mysql</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
    </resource-ref> 

    You might have more answers if you post this same question in the Sun Java Studio Enterprise forum...
    http://swforum.sun.com/jive/category.jspa?categoryID=90

  • Accessing separate databases for two Wb Apps.

    I have two entries in my weblogic.properties file for two web apps:
    # Netstride portal deployment
    weblogic.httpd.webApp.webapp=D:/dev/portal/public_html/
    # Defines the ISPS portal WAR deployment.
    weblogic.httpd.webApp.isps=D:/dev/ISPS_app/public_html/
    and my connection Pool entry in weblogic.properties file is:
    weblogic.jdbc.connectionPool.commercePool=\
    url=jdbc:weblogic:oracle,\
    driver=weblogic.jdbc.oci.Driver,\
    loginDelaySecs=0,\
    initialCapacity=3,\
    maxCapacity=50,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=2,\
    testConnsOnReserve=true,\
    testTable=dual,\
    refreshMinutes=1,\
    props=user=inet2;password=in3t2;server=ispsdevl;weblogic.t3.waitForConnection=true;weblogic.t3.waitSecondsForConnection=999999999999,\
    weblogic.jts.waitSecondsForConnectionSecs=999999999999,\
    verbose=false
    The webLogic JDriver entry in weblogiccommerce.properties file is:
    #------WebLogic jDriver for Oracle 8.1.5 jdbc20---------#
    commerce.usermgmt.RDBMSRealm.driver=weblogic.jdbc.oci.Driver
    commerce.usermgmt.RDBMSRealm.dbUrl=jdbc:weblogic:oracle
    commerce.usermgmt.RDBMSRealm.dbServer=ispsdevl
    #commerce.usermgmt.RDBMSRealm.dbUser=inet
    #commerce.usermgmt.RDBMSRealm.dbPassword=in3t
    # FOR GOING AGAINST INET2 SCHEMA
    commerce.usermgmt.RDBMSRealm.dbUser=inet2
    commerce.usermgmt.RDBMSRealm.dbPassword=in3t2
    If I want to point the 1st app to database schema inet and the 2nd app to inet2
    schema, what changes in weblogiccommerce.properties.
    I think in weblogic.properties file i will have to have two different connection
    pools for the two apps. am I right?
    I zipped the weblogic.properties and weblogiccommerce.properties files into webLogic.zip
    and attaching the zip file.
    Thanks.
    [WebLogic.zip]

    i think you need to use link server to create the bridge.
    http://msdn.microsoft.com/en-us/library/ms188279.aspx

Maybe you are looking for

  • How to export database image from form 9i to excel??

    I hv some image sotred as blob in database and want to export them from form to excel here is my code: DECLARE MyApplication OLE2.OBJ_TYPE; workbooks OLE2.OBJ_TYPE; workbook OLE2.OBJ_TYPE; worksheets OLE2.OBJ_TYPE; worksheet OLE2.OBJ_TYPE; cell OLE2.

  • Portege 2010 - Cannot find the END button in order to save BIOS changes

    I couldnt save my Bios setup because i can't find the end keys to save the changes. I tried to hit all the keys in keyboard but none of it save the settings. Can you show me the keyboard diagram showing the end keys? I have toshiba portege 2001 serie

  • Cannot perform Goods Receipt in SRM

    Hi All: When I'm trying to perform GR/ Confirmations in SRM I get the following message. "No documents correspond to search criteria or no authorization" .  I have tried the following roles BBP_STAL_EMPLOYEE and BBP_MULTI_EMPLOYEE to no avail.  I see

  • Color Labels in iTunes Playlist

    Has anyone ever come across a script or a way to color code tracks in the the playlist? Seems like a no brainer- I know there's all kinds of ways to organize the columns, but the simple ability to color code would be so helpful- anyone? Thanks, John

  • Solution to hanging mail when responding to certain emails

    I've had this annoying problem for a couple of months where I would get the spinning wheel of death when I would try and respond to certain emails. I've read multiple posts and suggestions and tried almost all of them to no avail. I finally read a te