Tomcat 7 and Oracle 11g

Hello Everyone,
I am facing a strange issue with tomcat 7 connectivity with Oracle 11g. I am using the below versions
JDK1.7.0_03
Tomcat 7
Oracle 11g
I used to connect to oracle9 with the thin driver, everything was fine, but when I try to connect to 11g, tomcat throws the error CONNECTION REFUSED. I created a seperate standalone java application to test the connection with the same peice of code, and I can see Oracle sends the connection, but with Tomcat 7 it throws the error. I have placed all the correct jar files in the tomcat lib directory and classpath. I am little lost as it works well as an individual application but not from Tomcat. No exception or other error is thrown by Tomcat
Can anyone help me on this
Thanks in advance

926901,
I am havnig what I think is a very similar issue. I am brand new to java and to configuring any kind of server at all. I am using the versions below:
JDK 1.7.0_04 - on my local machine
JRE 7 - on my local machine
Tomcat 7 - installed on my local machine
Oracle 11g - on a different server on my company's network
I created a login page using scriptlets in a jps file and could connect using the following, but it is not on a tomcat server (on my company's development box):
String dbURL = "jdbc:oracle:thin:@10.5.20.101:1521:myDB";
String dbUser = "*****";
String dbPass = "*****";
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
con = DriverManager.getConnection(dbURL,dbUser,dbPass);
I am now trying to do the same login, connecting to the same DB (same url/UN/PW) using servlets from the tomcat server on my machine. I am writing the code in Eclipse also, and have pointed eclipse to the JDK and JRE folders. You mentioned that you have placed all the correct jar files in tomcat lib directory. Would you please tell me what jar files you used? I am finding a lot of people saying I need to put the oracle driver into the WEB-INF/lib folder directly in the specific web app, and some say it is fine in the tomcat lib folder, and I am seriously frustrated with it. I am not sure if I should be using the class12.jar file or the ojbdc14.jar file either. Please, any advice you can give me would be appreciated. I have been going in circles for days and nothing seems to let me connect to the DB from a servlet running in Eclipse on tomcat. The code I am trying to use on tomcat in the servlet is:
import java.sql.*;
import java.util.*;
import oracle.jdbc.*;
public class ConnectionManager
     static Connection con;
     static String dbURL;
     public static Connection getConnection()
          try
               String dbURL = "jdbc:oracle:thin:@//10.5.20.101:1521:myDB";
               String dbUser = "*****";
               String dbPass = "*****";
               // assuming "DataSource" is your DataSource name
               Class.forName("oracle.jdbc.OracleDriver");
               DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
               //try
                    con = DriverManager.getConnection(dbURL,dbUser,dbPass);
               //catch (SQLException ex)
               //     ex.printStackTrace();
          catch(ClassNotFoundException e)
               System.out.println(e);
          return con;
}

Similar Messages

  • Terminology differences between MSSQL 2005/2008 and Oracle 11g

    I'm looking for some articles/books/webinars/blogs which discuss the terminology differences between MSSQL 2005/2008 and Oracle 11g in terms of database concepts. I have found this article http://www.sqlservercentral.com/articles/SQL+Server/67007 so far.
    Thanks.

    Thanks sb92075. Those returned results are almost all related to compare the features/functionalities between MSSQL and Oracle not to distinguish the terminology differences between them.

  • Solaris 10 Sparc and Oracle 11g DB with GG

    Hi,
    I have Solaris system with Solaris 10 Sparc and Oracle 11g DB.
    From the Golden gate download list I downloaded the Golden Gate for Oracle 11g and Solaris 10.
    I tried to Install but I am getting the following error..
    $ ldd ggsci
    ldd: ggsci: ELF machine type: EM_AMD64: is incompatible with system
    Can you please let us know which might be the best golden gate software for us.

    Vinod wrote:
    I have Solaris system with Solaris 10 Sparc and Oracle 11g DB.
    From the Golden gate download list I downloaded the Golden Gate for Oracle 11g and Solaris 10.
    I tried to Install but I am getting the following error..
    $ ldd ggsci
    ldd: ggsci: ELF machine type: EM_AMD64: is incompatible with system
    Can you please let us know which might be the best golden gate software for us.Possibly the solaris x86_64 build was downloaded, instead of the build for solaris sparc? (I think all of our current solaris builds are 64-bit.) It's almost certainly a download / OS mismatch.
    What exact file did you download (what's the file name, before unzipping it), and on your solaris box, what's the result of => "uname -a" and/or "isainfo -v" ...? Just make sure the downloaded file matches what the box is running...
    Btw, not that it matters in this case, but if you were hypothetically running a 32-bit database on a 64-bit OS, you'd need a 32-bit build of GoldenGate. But I don't know why you'd do that. (And that's not the problem here.)

  • Is it possible to install oracle 11g client 32 bit and oracle 11g client 64

    Hi,
    I have Windows 2008 R2 64 Bit Operating Server Installed.
    Other software that are Installed :
    1) Visual Studio 2010 Ultimate 32 Bit.
    2) Microsoft SharePoint server 2010 64 Bit.
    For my development purpose I want to install both oracle 11g client 32 bit and oracle 11g client 64 on the same machine.
    Is it possible to install both 32 and 64 bit instance on the same machine.
    Thanks
    Sambit

    959211 wrote:
    Hi,
    I have Windows 2008 R2 64 Bit Operating Server Installed.
    Other software that are Installed :
    1) Visual Studio 2010 Ultimate 32 Bit.
    2) Microsoft SharePoint server 2010 64 Bit.
    For my development purpose I want to install both oracle 11g client 32 bit and oracle 11g client 64 on the same machine.
    Is it possible to install both 32 and 64 bit instance on the same machine.
    Thanks
    Sambityes, possible; but minor challenge to manage dynamically
    how to ensure that you actually use the flavor you desire?

  • Running both Tomcat and Oracle !

    Can anyone tell me how to setup Tomcat and Oracle on the same machine so that they both can be accessed through port 80.
    I am using Tomcat 5.0.24 and Oracle 9i.
    I would be glad if anyone can send me links to useful resiurces !!!
    Thanks !!!!

    Hi,
    Thank you much for your reply.
    Right now I am running my Tomcat on port#7000. I want it to run on port#80 because my network admin has set firewall on port#7000.
    Do u know anyway of connecting Tomcat and oracle so that they both can run on same port or is there any other way out ?????
    Thanks !!!

  • Create PDF report with APEX and Oracle 11g doesn't work

    Hi everyone,
    I have a problem with the downloading of PDF reports from APEX with Oracle 11g.
    When I try to download a PDF, Acrobat Reader says it can not open the file.
    I have done the same test in an environment with APEX and Oracle 10g and it works perfectly.
    Does anyone know if there is a known bug for version 11g.
    Thank you very much.

    Hi Munky,
    I open the generated file the Notepad++ I can read the next message:
    *<HTML><HEAD><TITLE>500 Internal Server Error</TITLE></HEAD><BODY><H1>500 Internal Server Error</H1>OracleJSP:*
    An error occurred. Consult your application/system administrator for support. Programmers should consider setting the init-param <code>debug_mode</code> to "true" to see the complete exception message.</BODY></HTML>
    I have not idea can I solve the problem.
    Have you got any solution for this problem??
    Thank you so much.
    Victor Muñoz.

  • New installation woes - SQLDeveloper on Oracle Linux x64 and Oracle 11g XE

    Note that as an experienced Oracle developer in enterprise environments running MS Windows OS, I am familiar with SQLDeveloper for Windows. I don't have a lot of experience with Linux however. I don't find it intimidating, I just don't have a lot of accumulated knowledge.
    I have recently been trying to set up a development environment on my Windows7 Professional x64 laptop.
    1. Installed Oracle VBox
    2. Installed Oracle Linux 5.2 inside the VBox (because Oracle 11g XE is not certified on 64 bit Windows, needed to go with a Linux OS)
    3. Installed Oracle DB 11.2 XE
    4. Installed JDK as instructed in the SQLDeveloper release notes for Linux x64
    5. Installed SQLDeveloper 3.1.07.42-1
    No apparent issues with any of the installations.
    Problem : I can run SQL Plus from the command line, but when I click on the icon for SQLDeveloper, nothing happens. No error messages, nothing else.
    Question #1 : Unsure how to debug/troubleshoot this. Will read through the installation and release notes for SQLDeveloper, but any suggestions would be welcome.
    Question #2 : Could this be due to an issue with the JDK installation? It appeared to be successful (no obvious issues) but I can't see anything in the Oracle Linux menu system that tells me the JDK was installed successfully. How can I confirm that the JDK installation was successful?
    Edited by: Peter Hartgerink on Jun 19, 2012 9:12 AM

    >
    The Linux x64 version of SQLDeveloper doesn't come bundled with JDK. There is a version of JDK recommended, with an advisory to install it before installing SQLDeveloper. This I did, with apparent success. I guess I'll have to install the JDK again and check my Java versions afterwards. Thanks.
    >
    I don't know what JDK you downloaded since you didn't say. What version was it? Post the link.
    I find it hard to believe that the JDK version recommended was 1.4.2 since that is an ANCIENT version of Java, you have to hunt to even find it for download and most importantly the sql developer main download page clearly announces what version of Java is needed.
    http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
    >
    JDK Support
    Oracle SQL Developer 3.1 is shipped with JDK1.6.0_11. However, you can connect to and use any JDK 1.6.0_11 or above. To use an existing JDK, download the zip files listed below "with JDK already installed."
    >
    As you can see you need JDK 1.6.0_11 or above.
    If the version you say was recommended was actually 1.4.2 then that is an error; post the details so the developers can get that error fixed.
    I don't know what is on your system and can only go by the information you provide
    >
    4. Installed JDK as instructed in the SQLDeveloper release notes for Linux x64
    java version "1.4.2"
    >
    You either downloaded version 1.4.2, which seems unlikely, or your Linux included 1.4.2 and it is being used when you try to launch sql developer.
    Perhaps your system now has multiple versions of Java on it but the version being used by sql developer is the wrong one. If so that is the issue you need to resolve.

  • Xpath difference between Oracle 10g and Oracle 11g

    All,
    I'm working on moving our existing stored functions from Oracle 10g (10.2.0.4.0) to Oracle 11g (11.2.0.1.0) and so far, everything has worked just fine on Oracle 11g...execpt for one xpath statement.
    The statement below works fine in Oracle 10g (10.2.0.4.0):
    extractValue(inv_dtl_img, '/service//ground/sortKeyCode') AS "srt_key_cd",
    Please note: I need to use the double slash "//" in order to ignore the two different elements in the schema.
    However, in Oracle 11g (11.2.0.1.0), when this statement is executed in the stored function, I get this:
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got -
    The extractValue command is pulling data out of an XMLType column, and the corresponding XML schema looks like:
    <service>
    <trans>
    <ground>
    <sortKeyCode>
    </sortKeyCode>
    </ground>
    </trans>
    <nontrans>
    <ground minOccurs=0>
    <sortKeyCode>
    </sortKeyCode>
    </ground>
    </nontrans>
    </service>
    Please note: In the XML message, the "trans" and "nontrans" elements are exclusive, so both will never be populated at the same time. A typical XML message would look like this:
    <service><trans><ground><sortKeyCode>3</sortKeyCode></ground></trans></service>
    or this:
    <service><nontrans><ground><sortKeyCode>5</sortKeyCode></ground></nontrans></service>
    In the schema, the sortKeyCode has been defined in both places as "string maxlen=3", so the datatype of that element is exactly the same in both the "trans" and "nontrans" sections of the schema. The only difference in the schema (outside of the trans and nontrans tags) is the fact that the second "ground" tag is defined with a "minOccurs=0". Could Oracle 11g be treating the schema differently than Oracle 10g, resulting in the error?
    Any thoughts would be appreciated.

    The only way to get an quick answer to that one is to file a service request with Oracle support. It could be a bug or a correct change regarding W3C behavior. Despite this, you moving to 11.2, the extract/extractvalue etc propriety Oracle solutions are deprecated from 11.2 and onwards. The more sensible way to move forward, although, I know more work intensive, is to apply the XQuery alternatives like xmlexist, xquery or xmltable functions.
    Moving to EXTRACT is a bad idea, because this alway will be treated as an XML fragment. If you unlucky then Oracle will deal with this in memory via DOM (the standard solution regarding XML parsing if every smart thing within Oracle can not be applied) and this will result in a performance downgrade due to high CPU and Memory consumption/overhead...
    Your pick...

  • Difference between Oracle 10g and Oracle 11g when using Distinct in SQL

    Hi All,
    When I use Distinct in Oracle 10g, the result would be sorted in ascending order automatically, while there is no sorting in the result set in Oracle 11g.
    I was using plsql developer to run my sql.
    May I know if anyone have the same experience before?
    Is there any kind of setting in 11g that I can make the result in order? Thanks!
    Edited by: user5810051 on 2011/4/6 下午 8:47

    As acadet says, if you want your result ordered you must specify an ORDER BY clause in your query. Just because previous versions of oracle included some ordering as part of the processing of a query, that was not a guaranteed ordering, but just a side-effect. Now that Oracle have improved the internal workings, they've removed the side-effect, and that's why you're not getting the ordering you want, because you were relying on that side-effect rather than explicitly stating the order you wanted.

  • DataGuard on Oracle 9i and Oracle 11g

    Hi Guys,
    Is it possible to configure DataGuard between an Oracle 9i primary database and an 11g standby?
    Thanks for the help.
    Carlos

    See this MAA paper - http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2-rollingupgradebestprac-1-132006.pdf which explains a rolling upgrade using a Data Guard standby. The caveat is that you will have to create a 10.2.0.4 physical standby on the new hardware and convert it to a Logical Standby before upgrading it to 11.2. So you will have to have both homes on the new hardware. So your database has to be able to support a Logical standby.
    Also, depending on the hardware change the combination has to be a supported one as detailed in the MOS note " Data Guard Support for Heterogeneous Primary and Physical Standbys in Same Data Guard Configuration" [ID 413484.1]
    Going from a single instance to a RAC is no problem.
    Thanks.
    Larry

  • Integrity check of tables between Oracle 9i and Oracle 11g

    Hi,
    |Is there a tool or a way to check the integrity of data in the tables after migrating data from an Oracle 9i database to an Oracle 11g database?
    Thanks for you help.

    Hi,
    How do you want to proceed for your migration ? Assuming everything was OK in your 9i database normally things should go well whatever the method.
    For example as the previous posters mentioned if you use exp/imp and if you have "successfully without warnings" at the end of the operations you can trust those messages. Physical corruption is not the only possible problem and with exp/imp some things not to forget :
    - checking the compatibility of the source and target database charactersets and positioning correctly the NLS_LANG variables for exp and imp
    - activity on the source at the time of your export ? Your export has to be "logically" consistent.
    Oh and about block integrity do a good full rman backup on your 11g database after the migration and check v$database_block_corruption after the backup. RMAN is your friend about physical integrity. Even after an incremental rman backup if a query on this view gives 0 result you can be sure you have no block corruption (at least if block_change_tracking is not used)
    Best regards
    Phil

  • Microsoft ODBC for Oracle on a Windows 7 64Bit OS and Oracle 11g Client

    Hi,
    I have installed Oracle 11g client 64Bit edition on a Windows 7 Professional 64Bit OS. Trying to connect to Oracle DB through ODBC Driver I get the following Message:
    Microsoft ODBC for Oracle:
    "The Oracle(tm) client and networking components were not found. These components ar supplied by Oracle Corporation and are part of the Oracle Version 7.3 (or greater) client software installation....".
    Any ideas how to resolve that problem?

    Hello,
    Please verify the ORACLE_HOME directory is listed on the PATH system variable of Windows 7. Please open the Command Prompt
    and examine the result of the command PATH.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Help identify Difference between Oracle 9i R1 and Oracle 11g

    Hi Folks
    I am a newbie / student who is practicing Oracle SQL/ PL-SQL using Oracle 9i Release 1 (V9.0.1.0). I would like to know if there is a significant difference in the way SQL statements are written for current release of Oracle (11g2) and the version i am using .
    Thank you in advance
    Mandar Powale

    user12969380 wrote:
    I had done a course on Oracle 5-6 years back when 9i was in vogue, the institute gave me Oracle's official notes for oracle 9i, that is why i am using oracle 9I.I don't have books to learn Oracle 11gr2You can found all the documents you need to learn/practice Oracle 11g at
    http://tahiti.oracle.com
    http://www.oracle.com/technology/documentation/index.html
    Regards
    Anurag

  • Srvctl and Oracle 11g

    Hi,
    I see that Oracle 11g srvctl utility no longer takes the '-c' option to specify the connect string as it used to work in 10g and 9i. What is the replacement for this then? How can I login as a non Oracle OS user and use the srvctl command? How do I supply the sys credentials at all? It would be great if any of you could help me out here.
    Thanks.

    Now a days Oracle 9i not supported by oracle. However Oracle 9i also not supported for windows 7. So your time may waste. So try to download oracle 11gr2 and use it on windows 7 machine
    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
    Note : If you want oracle 9i software, you can send request to oracle support. they will arrange for you.

  • Tomcat and Oracle

    Hi. I have tomcat 6 and Oracle 10g Express edition 10.2.0.1.0 and I have to make a jsp page that would connect to my database and get data from it.
    In server.xml I added:
    <Resource name="jdbc/myoracle" auth="Container"
    type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:@127.0.0.1:8080:apex"
    username="hr" password="hr" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    and in web.xml:
    <resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/myoracle</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    I also downloaded ojdbc14.jar driver and placed it into tomcat/lib folder.
    now, I dont know how to connect to the database in my jsp page and what imports to make, I tried to search the web and couldnt find anything specific.
    Can you please help me? How would I for example list all entries from say Employees table that is already created.
    Thanks

    Hi,
    Found the solution best described in below link.
    http://wiki.apache.org/tomcat/UsingDataSources
    Im using tomcat 6.0.18 on vista and oracle 10g. Hope this Infomation might help someone.
    1. comment following line in TOMCAT_HOME\conf\context.xml
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    2. copy following in ur web applications META-INF\context.xml
    <?xml version='1.0' encoding='utf-8'?>
    <Context>
    <Resource name="jdbc/oraclexe" auth="Container"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:@127.0.0.1:1521:xe" username="oracle"
    password="oracle" maxActive="20" maxIdle="10" maxWait="-1" />
    </Context>
    3. no need to edit TOMCAT_HOME\conf\server.xml or WEB-INF\web.xml.
    Hope this helps
    bye

Maybe you are looking for

  • IR has been completly done on PO,but still has open items in MIRO.

    Hi MM experts, IR has been completly done on PO ,but still system allowing us to do  MIRO against PO. How it is possible. Current PO status: This is intercompnay PO (plant to plant stock transfer) not STO.  PO Qty is 60,000 KG, they have done GR part

  • My 7th generation nano is stuck in recovery mode loop

    Any suggestions?  Already reset by holding hold button and on/off.  Already removed and redownloaded itunes.  This is my 2nd nano with the same issue.

  • How to restore files from Adobe Reader for iOS (iPad)?

    I started using Adobe Reader for iOS to annote and comment pdf files. I used the Adobe Reader for Mac OS to upload the files to the Acrobat.com cloud. Opening the files on iPad worked pretty straight forward and I started editing the pdf right away.

  • Problems with SubMenus

    Hi all... I have a Menu called ActionEvents which has a JMenu called mouseEvents. What I want is to add a submenu to this (mouseEvents), I tried the following: mouseEvents.add(new JMenuItem("New Item"));This compiles fine but doesnt show up on the ap

  • Extracting Clips from DVD...

    Hey guys, Im going to be extracting clips from a DVD to put together a highlight film for a hockey player. What software will allow me to put in a DVD, extract the clips I need, and then put it into final cut express or imovie to create a highlight f