Problem accessing oracle databse with JSP

hI
i'M TRYING TO ACCESS A ORACLE 8I DATABASE VIA A JSP. THE DATABASE IS LOCATED REMOTELY ON THE NETWORK AND I' USING JDEVELOPER 9i VERSION 9.0.3.1
wHEN I RUN MY JSP, I WANT IT TO DISPLAY THE RESULT OF A QUERY ON MY JSP PAGE but instead i get this error on my error page : java.lang.NullPointerException
what do u think is wrong with my code
here it is :
<%@ page language="java" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.io.*" %>
<%@ page errorPage="errorpage.jsp" %>
<%@ page contentType="text/html;charset=windows-1252"%>
<%
String uname= request.getParameter("username");
String pword= request.getParameter("password") ;
String driverName = "oracle.jdbc.driver.OracleDriver" ;
String dbUrl = "jdbc:oracle:thin:136.150.11.3:1521:orcl" ;
/*String user = "hr8" ;
String pass = "password" ; */
Connection con= null ;
Statement stmt = null;
     ResultSet rs = null;
try
{ //loading driver
Class.forName(driverName);
catch (ClassNotFoundException e) {
out.println("Unable to load driver class");
try // connecting to the database
con = DriverManager.getConnection(dbUrl,uname,pword);
catch(SQLException ex){
out.println("Error while connecting to the Database :" +
""+ ex.toString() );
// create query
stmt = con.createStatement();
rs = stmt.executeQuery("select COUNTRY_NAME ,REGION_ID " +
"from COUNTRIES where REGION_ID in (1,3,5,7,9);");
while (rs.next())
out.println(rs.getString(1));
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>
LOGIN UNITRANSFER
</title>
</head>
<body>
<h2>
I got it
<%
out.println(uname);
%>
</h2>
<p>
</body>
</html>

The dbUrl should be of the format:
"jdbc:oracle:thin@" + serverName + ":" + serverPort
+ ":" + dataBaseSID;
String dbUrl = "jdbc:oracle:thin:@136.150.11.3:1521:orcl";

Similar Messages

  • Problem accessing R/3 with SSO ticket from the EP6.0

    Hi all,
    I have seen this thread: Problem accessing R/3 with SSO ticket from the EP6.0
    I know that it is possible to read SSO ticket from the Cookie in WebDynpro application.
    Now we are at the first step, we don't know how to read SSO ticket from the Cookie in WebDynpro application with java code.
    So anyone can help us?

    Hi,
    This has been discussed in a previous forum.Check this link.A code snippet is also there to read a cookie in webdynpro with this question
    How to implement SSO between Portal, Webdypro and ABAP system?
    I am not able to send the link exactly.
    Regards,
    Sowjanya.
    Message was edited by: Sowjanya Chintala

  • How to access Oracle 10g with COBOL

    Hi there,
    I didn't find anywhere better to post this, so I'm sorry if this is the wrong place.
    I'm having major problems trying to find out how to access an Oracle 10g database with COBOL because I have no directions. I've never programmed anything that access a database before, and my first time must be in COBOL (wich is a language I started learning yesterday)
    My teacher (who is not a nice person) gave us no directions at all, and when we ask her for it she is rude
    "Do you know something called library? Or maybe, Google?"
    So I am here, desparate, asking for anyone's help, for any diirections.. like
    -How to access?
    -Wich COBOL compiler to use? (free)
    -Do I access the database with commands in COBOL? wich commands?
    -Any tutorial around the web about this?
    I have to deliver the full project in a month.. lol
    Oh well...
    thanks in advance!
    Oscar

    I do understand if she want us to be resourceful, but yes, she was tottaly irresponsible with us... but what is done is done.
    Thanks alot for the information APC
    I gave a quick look on the documentation you gave me and it is perfect, I now know how to connect to the database and somewaht use the commands.
    But I looked for 2 more things and didn't find it, I'm sorry if I missed there
    1) Do I need to instal anything? Something like a Pro*COBOL installer? I'm using Fujitso COBOL compiler, do I need to use other?
    2) I looked at the commands on how to connect to the database but I don't understand something (again, sorry if I missed something)
    LOGON.
    MOVE "SCOTT" TO USERNAME-ARR.
    MOVE 5 TO USERNAME-LEN.
    MOVE "TIGER" TO PASSWD-ARR.
    MOVE 5 TO PASSWD-LEN.
    EXEC SQL
    CONNECT :USERNAME IDENTIFIED BY :PASSWD
    END-EXEC.
    DISPLAY " ".
    DISPLAY "CONNECTED TO ORACLE AS USER: ", USERNAME-ARR.
    How does the CONNECT command know where to connect? I mean.. where do I put the adress of my Oracle Database?
    That's all I could think about with this quick look, when I start implementing I will read the guide with all my attention.
    Thanks again for the help
    Oscar

  • XI cannot access oracle databse

    A IDOC to JDBC scenario is created in the XI. The database is SQL Server 2000. The adapters are IDOC and JDBC. The scenario is working fine.
    Next, the existing database (tables+data) in SQL Server  2000 is transferred to an Oracle Database. The JDBC communication channel is changed to access the corresponding table in the Oracle databse. i.e. driver, url, userid, password etc and classes12.jar is imported for the scenario.
    The scenario can create connection to the database successfully but cannot recognize the table attributes. i.e. delete from tableName is working fine but insert into tablename(col1, col2 ..)values(val1, val2) is not  working. The error generated is a given below,
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. <tableName> (structure 'STATEMENTNAME'): java.sql.SQLException: FATAL ERROR: Column <columnName> does not exist in table <tableName>
    The table attributes in the Oracle database are in CAPITAL letter while the corresponding dataType node is in SMALL letter. i.e. EMPNO in database and empno in dataType. Surprisingly, If I change the dataType node to CAPITAL letter then it works.
    The SQL should not be case sensitive.
    Some advice on why it is happening and the remedy is urgently needed.
    thanks and regards,
    Rana Brata De

    Hi
    This happens. its recommended to use capital letters in XML SQL
    See SAP Note 831162.
    Thanks
    Gaurav

  • Problems accessing Yahoo email with Mail on iMac

    Hi, I can happily access my emails from Yahoo using my iPhone and iPad. However, neither my MacBook Pro or my iMac (both running Mavericks) can access my emails using "Mail". I can use Webmail on Safari ok, but whenever I try to access Yahoo mail with "Mail", I get a message saying I should re-enter my password, or that the Server is unavailable. I have 2 stage authorisation activated, and "Keychain", and I had to enter a special 'Yahoo-generated' password to allow my iOS units to work. However, each time I use my OSX units, an email says an unauthorised attempt to access my mails has been made.
    I've tried deleting the account and reinstalling and rebooting etc, to no avail. I think that Yahoo needs to authorise the iMac and Macbook, but I can't work out how to do it.

    Ive found the solution to this problem. Its the secondary sign in system used at Yahoo for unauthorised sign-ins. While its possible to authorise an iPad or iPhone using a special one off password, this cannot be done on a desk top. The simple solution is to switch off the secondary security sign-in option.

  • Using Oracle 8i client, can I  access  oracle server with version 10g ?

    Hi ,
    I am a developer working with C++ and Oracle. In Oracle particularly I am new.
    I have some basic Question related to oracle.
    1. With Oracle 8i client Can I connect to Oracle server with version 10g?
    2. With Oracle 8i client Can I connect to Oracle server with version 9i?
    3. With Oracle 9i client Can I connect to Oracle server with version 10g?
    4. With Oracle 10g client Can I connect to Oracle server with version 8i?
    5. With Oracle 10g client Can I connect to Oracle server with version 9i?
    6. With Oracle 9i client Can I connect to Oracle server with version 8i?
    These are basic yes/no type question.
    Thanks & Reagards
    Ravi Bhushan

    All answers on Metalink Note:207303.1 - Client / Server / Interoperability Support Between Different Oracle Versions

  • Problems using Oracle ODBC with Access

    Windows xp 64
    Oracle thick client 10.2.0.1
    When I test my ODBC connection in the Windows ODBC Admin Utility, it tests out fine. However whenever i try using a connection or creating within Access, I get error: "[Microsoft][ODBC Driver for Oracle][Oracle]ORA-12154: TNS:could not resolve the connect identifier specified (#12154) [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed IM006 0 [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed (#0)"
    Any suggestions? Thanks

    There's a known issue where 12154 occurs when an application has parenthesis in it's path, and MSAcces (being 32 bit) would get installed by default to c:\program files(x86).
    Patching the client to 10204 should resolve this issue for you.
    Greg

  • Problem accessing SQL Developer with user sys

    Hi Experts;
    I'm working with Oracle 10G, in Solaris 10, The DB apparently is working properly, but I can not access the DB thru SQL Developer. When I try to acccess with user sys, and I enter de password, in oracle role I select sysdba, when I choose connect I get this error message:
    ORA-01017: invalid username/password; logon denied
    However, I can connect with other user without any problem.
    I was connecting directly in the server, with sqlplus /as sysdba and I changed the password for user sys, but still the problem continues.
    What is wrong with this. I got the same problem if try to connect thru OEM.
    Thanks and regards
    Al
    Edited by: user12048358 on Jul 8, 2011 12:02 PM

    Hi Buntoro;
    Thank you for answer.
    First, I'm completely sure I'm using the correct password, to be sure I changed the password thru sqlplus.
    I'm using tns connection, btw, with the same connection, I can connect, but with other user.
    I was trying again, however, with the same results previous explained.
    But also I have the same problen when I tried to connect to OEM, and I was trying to stop the dbconsole, and found this:
    export ORACLE_SID=YAWIDBLAB
    emctl status dbconsole
    OC4J Configuration issue. /opt/oracle/102/oc4j/j2ee/OC4J_DBConsole_yawi-db-lab01_YAWIBLAB not found.
    export ORACLE_SID=YAWIDBLA
    emctl status dbconsole
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    http://yawi-db-lab01:1158/em/console/aboutApplication
    Oracle Enterprise Manager 10g is running.
    Logs are generated in directory /opt/oracle/102/yawi-db-lab01_YAWIDBLA/sysman/log
    If I type export ORACLE_SID=YAWIDBLA and then sqlplus /nolog
    SQL> connect /as sysdba
    Connected to an idle instance.
    But, when I connect settiong the SID in this way:
    export ORACLE_SID=YAWIDBLAB
    sqlplus /nolog
    SQL*Plus: Release 10.2.0.4.0 - Production on Sat Jul 9 23:03:15 2011
    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
    SQL> connect /as sysdba
    Connected.
    SQL>
    Apparently, there is problem with the tnsnames. When I see the tnsnames in SQL DEVELOPER I see this: YAWIDBLA
    So, here is the tnsname, in order you have a better idea, what I have.
    YAWIDBLA =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = yawi-db-lab01)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = YAWIDBLAB)
    Is the first time I see this kind of problem.
    Have an idea of what's happening;
    Best Regards;
    Al

  • Problem connecting oracle database to jsp pages using Apache Tomcat server 8.0

    Well...I tried too many things..googled so many times..but still could not find solution to my problem.
    I use windows 8 Enterprise Edition(if this has to do something with the problem)
    Oracle 11.2.0
    Apache Tomcat server 8.0
    JDK 1.7
    My oracle is installed in the D: drive and tomcat in c:. i copied the ojdbc6.jar file from oracle to lib directory of tomcat server.
    Then i set  CLASSPATH in environment variables as "C:\Program Files\Apache Software Foundation\Tomcat 8.0\lib\ojdbc6.jar" in system variables
    My path variable is set as "C:\Program Files\Java\jdk1.7.0_02\bin".
    My program is as follows in notepad:
    <%@ page import="java.sql.*" %>
    <html>
    <body>
    <%
    Connection conn;
    Statement st;
    ResultSet rs;
    try{
    new oracle.jdbc.driver.OracleDriver();
    String dbURL="jdbc:odbc:oracle:thin:@localhost:1521:XE";
    String userId="system";
    String pwd="moon";
    conn=DriverManager.getConnection(dbURL,userId,pwd);
    st=conn.createStatement();
    rs= st.executeQuery("SELECT * FROM login");
    while(rs.next())
    System.out.println(rs.getString(1)+""+rs.getString(2));
    catch(Exception e){}
    %>
    </body>
    </html>
    I get too many errors then
    eroors
    org.apache.jasper.JasperException: An exception occurred processing JSP page /page2.jsp at line 14
    11: String userId="system";
    12: String pwd="moon";
    13:
    14: conn=DriverManager.getConnection(dbURL,userId,pwd);
    15: st=conn.createStatement();
    16:
    17: rs= st.executeQuery("SELECT * FROM login");
    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    root cause
    javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:905)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:834)
         org.apache.jsp.page2_jsp._jspService(page2_jsp.java:102)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
         org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    Nothing solved this problem.

    >> Nothing solved this problem.
    Can't fix a problem 'till an actual problem is identified.
    >> ODBC Driver Manager ... Data source name not found
    That appears to be ODBC drivers looking for a DSN (Data Set Name). If it wants a DSN, the DSN has to be specified in the code, and the DSN has to be configured in the windows host ODBC applet. So that is at least two squirrels to get in the right tree before moving forward. A ...host:...[port:]SID|service name are some of the bits needed in a jdbc connect string, and that is in no way related to DSNs. A Whole Different Animal. If it wants a DSN that might be what needs to go in the URL bit.
    And ODBC setups can be confusing, especially if an x64 OS is in the mix- if that is the case there are two different ODBC configuration applets, one for x64 the other for x86, and if one gets as far as talking to an actual database it might toss an architecture error. Only way to fix that "problem" is *delete* the ODBC DSN and then run the correct (maybe the x86) ODBC config utility, and set up the DSN. Again.

  • Problem in Oracle ADF with JDeveloper. JBO25001

    Hello All,
    I have to develop an application using oracle ADF and JDeveloper. To famalirize my self with the technology, I downloaded the Oracle ADF tutorial "Tutorial for Forms/4GL developers" from Oracle site.
    I am following this tutorial line by line, but still getting an error. I have created
    1) Entities
    2) Associations
    3) Views
    4) ViewLinks
    5) Application Module
    all by wizard.
    After I added my view and view link into the application module and tried to test it it gave me the following error.
    (oracle.jbo.common.ampool.ApplicationPoolException) JBO-30003: The application pool (.10E97657A25) failed to checkout an application module due to the following exception:
    ----- LEVEL 1: DETAIL 0 -----
    (oracle.jbo.JboException) JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.NameClashException, msg=JBO-25001: Name ServiceRequestsTable of object type Attribute already exists
    ----- LEVEL 2: DETAIL 0 -----
    (oracle.jbo.JboException) JBO-29000: Unexpected exception caught: oracle.jbo.NameClashException, msg=JBO-25001: Name ServiceRequestsTable of object type Attribute already exists
    ----- LEVEL 3: DETAIL 0 -----
    (oracle.jbo.NameClashException) JBO-25001: Name ServiceRequestsTable of object type Attribute already exists
    I changed the names of each object but still the problem persisted.
    If any body can help me on this I will really appreciate it. Thanx a ton in advance.
    I have downloaded and using the latest JDeveloper version 10.1.3.1.0.3984
    Please help me on this.
    Regards,
    Saket Maheshwary

    Saket,
    Did you ever get this situation resolved?
    I'm working thru the tutorial myself and get the same error except the object is Product.
    Do you have any clues?
    Thanks,
    Lonnie Spears

  • Can't Access Oracle EBS with a Lenovo X201 laptop

    My Company runs Oracle E-Business Suite version 11.5.10.2. I recently had to get a new laptop (Lenovo X201). I can log onto the Oracle Application Home Page and select a responsibility, but when I select an operation, like Invoice Inquiry in the Payables Module for instance, I get the following message, "This tab has been recovered. A problem with this web page has caused Internet Explorer to close and reopen the tab." The laptop is running the XP operating system and Internet Explorer 8.0.6001.18702. Our IT staff can't figure out the problem. They looked at all the usual cause for problems, like pop-up blockers, etc. They also spoke to Lenovo Support without finding a resolution. We experienced a similar problem with Dell laptops that they were able to resolve. Has anyone experienced this problem with a recent-vintage Lenovo computer and found a solution?

    Can you find any details about the error in Apache log files and/or Sun JRE Console Window?
    If the issue is reproducible, please make sure you meet the minimum requirements as per these docs.
    Recommended Browsers for Oracle E-Business Suite 11i [ID 285218.1]
    IE8 AND R12 SECURITY SETTING REQUIREMENT ON CROSS SITE SCRIPTING (XSS) [ID 1069497.1]
    Thanks,
    Hussein

  • Problem accessing e.book with the adobe log in details

    Hi
    I bought an ebook. I downloaded it onto a laptop. I had access t
    o it no problems. I had a problem with the laptop and I had to change. I am having a problem opening the same book on the new one it is giving me the following error if I log in my Adobe details The vendor account you entered is not associated with the item you  are trying to open. Try again.

    Did you register ADE on the old laptop with an Abobe ID? 
    If so, you just need to register the new laptop with that same Adobe ID.
    ~~~
    If not, you may be a bit stuck.
    The Adobe DRM infrastructure has some very undesirable features, and you may have hit one.
    When you first run ADE it gives you the option to authorize with an AbodeID, or some other option ('Not Yet'?, I forget exactly how they put it).
    That second option effectively authorizes with an 'anonymous' ID which has some very undesirable properties.
    ADE does give a tiny bit of warning if you make that choice, but not nearly strong enough.
    Any DRM books you buy or borrow get associated with a particular ID when you first process the .acsm and download a DRM .epub file.
    After that point it is not possible to change the ID with which the book is associated.
    You can copy it between devices (up to 6) associated with the ID and all will go fine, but you can't use it on a device associated with a different ID.
    You can change the ID associated with a device (remove the old one, ctrl-shift-D for an ADE computer, ctrl-shift-E for a plugged in eReader device, and associate with a new ID),
    but you can't change the ID associated with a book.
    An implicit/anonymous ID cannot be associated with any other device, and once an anoymous ID is removed (or lost through loss of device), I do not believe that it is possible to recover that same ID.
    Therefore it is not possible to regain access ot the book.
    ~~~
    Your best bet may be to try a DRM stripper such as epubee (google it).  Do not then sell or give away the DRM stripped book to anyone else as that is not legal.
    I'm not sure if that will work except on a device which has authorization for the ID associated with the book; in which case you may still be stuck.

  • Problem accessing exception object in jsp error page - Apache Tomcat 5.0.25

    Hi all,
    I'm thoroughly confused and need some help. I've deployed a very simple web application in Apache Tomcat 5.0.25 to test exception handling - errortest.jsp and error.jsp. errortest.jsp throws a divide by zero exception if executed with default values in text fields.
    When I put the directive IsErrorPage="true" in error.jsp i get a HTTP 500 error when error.jsp is accessed. If I remove it error.jsp is displayed but I cant access the exception object - if I try to I get an exception below:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 5 in the jsp file: /error.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    E:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\mywebapp\org\apache\jsp\error_jsp.java:46: cannot resolve symbol
    symbol : variable exception
    location: class org.apache.jsp.error_jsp
    out.print(exception.getMessage());
    ^
    1 error
    Below is the code for the two jsp pages:
    errortest.jsp:
    <%@ page errorPage="error.jsp" %>
    <html>
    <head><title>Error test</title></head>
    <body>     
         <form action="errortest.jsp" method="post">
         Enter first number:<input type="text" name="first" value="5"/><br>
         Enter second number:<input type="text" name="second" value="0"/><br>
         <input type="submit"/>
         </form>
         <%
         if (request.getMethod().equals("POST")) {
              int first = Integer.parseInt( request.getParameter( "first" ) );
              int second = Integer.parseInt( request.getParameter( "second" ) );
              int answer = first/second;
         %>
    </body>
    </html>
    NB: I am able to catch and display the exception if I use a try/catch block around the division as shown below.
    try {
    int answer = first/second;
    } catch( Exception e) {
    e.printStackTrace( new PrintWriter(out) );
    error.jsp (first draft)
    NB: HTTP 500 error occurs when directive "isErrorPage" is added:
    <%@ page isErrorPage="true" %>
    <html>
    <head><title>Error Page</title></head>
    <body>
    </body>
    </html>
    error.jsp (second draft)
    NB: directive is removed but exception thrown when implicit exception object is accessed. error.jsp displays if exception object is not accessed:
    <%@ page %>
    <html>
    <head><title>Error Page</title></head>
    <body>
    <%=exception.getMessage()%>
    </body>
    </html>
    Web server specs:
    Apache Tomcat 5.0.25
    Machine specs:
    Windows XP Pro
    Java environments:
    j2sdk1.4.2_03
    J2EE 1.4

    This works for me:
    throwError.jsp
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <%@ page language="java" errorPage="/error.jsp"
    contentType="text/html; charset=utf-8" %>
    <html>
    <head>
         <title>Throw Exception</title>
    </head>
    <body>
    Throwing exception....
    <%
    // throw ArithmeticException
    int badInt = 12/0;
    %>
    </body>
    </html>
    error.jsp
    <%@ page language="java" isErrorPage="true" %>
    <head><title>Doh!</title></head>
    An Error has occurred in this application.
    <% if (exception != null) { %>
    <pre><% exception.printStackTrace(new java.io.PrintWriter(out)); %></pre>
    <% } else { %>
    Please check your log files for further information.
    <% } %>

  • Problem accessing J2EE DataSource with BC4J

    I'm trying to create MySQL database connection with BC4J via a J2EE DataSource. But without success.
    The errors I receive:
    Launching OC4j...
    Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized
    2003-03-18 09:40:36 ApplicationModuleProvider - unspecified properties:
    password drivertype user sid connectionstring host encryptiontype port
    ApplicationModuleProvidernull
    java.lang.NullPointerException
    at oracle.cle.persistence.ConnectionProvider.getConnectionString(Connect
    ionProvider.java:606)
    at oracle.clex.persistence.bc4j.ApplicationModuleProvider.createModule(A
    pplicationModuleProvider.java:331)
    at oracle.clex.persistence.bc4j.ApplicationModuleProvider.getConnection(
    ApplicationModuleProvider.java:200)
    at oracle.cle.persistence.ConnectionProvider.getConnection(ConnectionPro
    vider.java:669)
    at oracle.cle.persistence.ConnectionManager.getConnection(ConnectionMana
    ger.java:607)
    at oracle.cle.persistence.DeploymentConnector.getConnection(DeploymentCo
    nnector.java:168)
    at oracle.cle.persistence.DeploymentConnector.getConnection(DeploymentCo
    nnector.java:92)
    at oracle.jheadstart.persistence.bc4j.handler.DataSourceHandlerImpl.getC
    onnection(DataSourceHandlerImpl.java:331)
    at oracle.jheadstart.persistence.bc4j.handler.DataSourceHandlerImpl.getA
    pplicationModule(DataSourceHandlerImpl.java:874)
    at oracle.jheadstart.persistence.bc4j.handler.DataSourceHandlerImpl.getD
    ataSourceSet(DataSourceHandlerImpl.java:462)
    at oracle.jheadstart.process.GetDataSourceSet.retrieveSimple(GetDataSour
    ceSet.java:538)
    at oracle.jheadstart.process.GetDataSourceSet.persist(GetDataSourceSet.j
    ava:502)
    at oracle.jheadstart.process.PersistingDataSource.start(PersistingDataSo
    urce.java:251)
    at oracle.cle.process.CLEStateMachine.start(CLEStateMachine.java:55)
    at oracle.cle.process.Process.start(Process.java:97)
    at oracle.cle.process.GenericProcess.start(GenericProcess.java:82)
    at oracle.cle.process.ParentProcess.start(ParentProcess.java:218)
    at oracle.cle.process.DisplayGroup.start(DisplayGroup.java:75)
    at oracle.cle.process.CLEStateMachine.start(CLEStateMachine.java:55)
    at oracle.cle.process.Service.start(Service.java:389)
    at oracle.clex.process.controller.HttpServletController.doPost(HttpServl
    etController.java:439)
    at oracle.jheadstart.process.controller.JhsHttpServletController.doPost(
    JhsHttpServletController.java:70)
    at oracle.clex.process.controller.HttpServletController.doGet(HttpServle
    tController.java:849)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:721)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:106)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
    utor.java:797)
    at java.lang.Thread.run(Unknown Source)
    ApplicationModuleProvider: ApplicationModuleProvidernull
    GetDataSourceSet Exception: A Connection could not be made for class: oracle.emp
    depdemo.resource.Department and sessionId: e3c568a09dec48d7b5a6cb86d041d22b orig
    inal message is: ApplicationModuleProvider: ApplicationModuleProvidernull
    See also thread MySQL at the JHeadstart forum.
    data-sources.xml (oc4j\j2ee\home\config):
         <data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="OracleDS"
              location="jdbc/OracleCoreDS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="scott"
              password="tiger"
              url="jdbc:oracle:thin:@172.16.2.240:1521:dev2"
              inactivity-timeout="30"
         />     
    cle-providers.xml:
    <cle-providers>
    <provider name="EmpDepServiceProvider" class="oracle.clex.persistence.bc4j.ApplicationModuleProvider">
    <property name="persistencebase" value="oracle.empdepdemo.persistence.bc4j"/>
    <property name="modulename" value="oracle.empdepdemo.persistence.bc4j.Bc4jModule"/>
    <property name="failover" value=""/>
    <property name="scope" value="request"/>
    <property name="managestate" value="false"/>
    <property name="configuration" value="Bc4jModuleLocal"/>
    </provider>
    </cle-providers>
    bc4j.xcfg:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BC4JConfig>
    <AppModuleConfigBag>
    <AppModuleConfig name="Bc4jModuleLocal">
    <DeployPlatform>LOCAL</DeployPlatform>
    <DBconnection>jdbc:oracle:thin:@localhost:1521:orcl</DBconnection>
    <JDBCName>ScottTiger</JDBCName>
    <jbo.project>empdep</jbo.project>
    <AppModuleJndiName>oracle.empdepdemo.persistence.bc4j.Bc4jModule</AppModuleJndiName>
    <ApplicationName>oracle.empdepdemo.persistence.bc4j.Bc4jModule</ApplicationName>
    </AppModuleConfig>
    </AppModuleConfigBag>
    <ConnectionDefinition name="ScottTiger">
    <ENTRY name="JDBC_PORT" value="1521"/>
    <ENTRY name="ConnectionType" value="JDBC"/>
    <ENTRY name="HOSTNAME" value="localhost"/>
    <ENTRY name="user" value="Scott"/>
    <ENTRY name="ConnectionName" value="ScottTiger"/>
    <ENTRY name="SID" value="orcl"/>
    <ENTRY name="JdbcDriver" value="oracle.jdbc.driver.OracleDriver"/>
    <ENTRY name="ORACLE_JDBC_TYPE" value="thin"/>
    </ConnectionDefinition>
    </BC4JConfig>

    Thank you Dhiraj,
    On my Oracle database it is working. But on MySQL I still have the same problem.
    I'm still ivestigating it.
    Thanks anyway.
    Marcel

  • Problem using JDBC driver with JSP

    Hi, I am trying to connecto to my mysql server via a JSP page, but it seems that there is a problem with the driver call or something in my configuration that unables me to connect. I have the mysql-connector-java-3.0.7-stable driver.
    This is how my classpath looks like:
    CLASSPATH=/home/hooper/Sources/mysql-connector-java-4.0.7-stable/lib:/home/hooper/Sources/mysql-connector-java-3.0.7-stable/com:/home/hooper/Sources/mysql-connector-java-3.0.7-stable/mysql-connector-java-3.0.7-stable-bin.jar:/usr/java/j2sdk1.4.1_02:.:/usr/java/j2sdk1.4.1_02/lib/tools.jar:/usr/java/j2sdk1.4.1_02
    And this is my JSP page code:
    <%@ page language="java" import= "java.sql.*"%>
    <%
    Connection con = null;
         String userName = "hooper";
         String password = ""; //No password
         String url = "jdbc:mysql://localhost/test";
         //Load the Driver class file
         Class.forName("com.mysql.jdbc.Driver");
         //Make a connection to the MySQL database
         con = DriverManager.getConnection (url, userName, password);
         out.println ("Database connection established");
              if (con != null){
                   //Close the connection
                   con.close();
    %>
    And this is the error I get from Tomcat4.1.18:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: com.mysql.jdbc.Driver
    root cause
    javax.servlet.ServletException: com.mysql.jdbc.Driver
    I hope someone can help me with this.
    Thanks,
    Luis

    Hi..
    Try using this way
    String userName = "hooper";
    String password = ""; //No password
    String url = "jdbc:mysql://localhost:3306/test";
    Class.forName("org.gjt.mm.mysql.Driver");
    try to download the driver for mysql and add it to your classpath
    Hope this works
    Regd
    Vasi

Maybe you are looking for