Session scope/Database connection

Hi y'all!
I got some questions about session scope and database connections:
I'm using a bean called dataBase. With this bean i open a database connection and execute some sql statements. the bean has page-scope, which means, as far as i know, the bean will be destroyed after the user leaves the current page.
but what happens with my dataBase connection?!? could it be possible that it is still active after the bean was destroyed? so should i close my database connection manually or will it close automatically when the bean is beeing destroyed?
thanks for your help!

You should explicitly close the connection. One way is to use the finally clause to ensure that the connection is closed even if your code throws an exception.

Similar Messages

  • How to immediately released database connection in jclient form app ?

    Hello Steve,
    We want our jclient form application could immediately released database connection when its be closed,
    We had follow your Weblog technical paper about http://radio.weblogs.com/0118231/stories/2005/02/10/amPoolingConsiderationsForAdfJclient.html , it mentioned following step to release Jclient database connection, but in our jclient project when we close separate jclient form application the database connection seems not immediately released(we monitor through TOAD trace session), the database connection will continue stay alive until we close the all project application.
    •Call panelBinding.releaseDataControl() method before our form application closed,
    •Set the AM pool's minimum available size to 0 (zero), and set the idle time and pool monitor interval shorter if the up-to 20-minute wait (in case it takes two wakeup cycles for the AM instance to be idle more than its idle time) is not something you like, or
    •Disable AM pooling altogether (jbo.ampooling.doampooling=false)In our project application the database connection behavior like following:
    1.when we open every Jclient form application , it will establish a new database connection for every form application
    2.But when we closed the jclient form application , the database connection still exist
    3.But when we open the same jclient form application again, the database connection will not create new database connection , it seems using the same connection when this application first create.
    4.when we close the all project application , it will release all database connection.
    Could you help us, thanks.
    Sincerely from, TIng-Rung

    Hello Steve,
    We have been study the paper that you mentioned, sorry that we still got some confused about AM pool and jdbc pool, My project bc4j,xcfg like following , could you help us what we missing ?
    ==============================
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BC4JConfig>
    <AppModuleConfigBag>
    <AppModuleConfig name="xxxAppModuleLocal">
    <jbo.ampool.maxinactiveage>5000</jbo.ampool.maxinactiveage>
    <user>xxx</user>
    <jbo.project>His</jbo.project>
    <AppModuleJndiName>com.xxx.business.module.xxxAppModule</AppModuleJndiName>
    <DeployPlatform>LOCAL</DeployPlatform>
    <jbo.poolmonitorsleepinterval>10000</jbo.poolmonitorsleepinterval>
    <jbo.poolmaxinactiveage>5000</jbo.poolmaxinactiveage>
    <JDBCName>NEWNTUHRIS</JDBCName>
    <RELEASE_MODE>Stateless</RELEASE_MODE>
    <jbo.recyclethreshold>0</jbo.recyclethreshold>
    <ApplicationName>com.xxx.business.module.xxxAppModule</ApplicationName>
    <java.naming.factory.initial>oracle.jbo.common.JboInitialContextFactory</java.naming.factory.initial>
    <password>xxxx</password>
    <jbo.poolminavailablesize>0</jbo.poolminavailablesize>
    <DBconnection>jdbc:oracle:thin:@10.0.0.8:1521:xxx</DBconnection>
    <jbo.ampool.minavailablesize>0</jbo.ampool.minavailablesize>
    <jbo.ampool.monitorsleepinterval>10000</jbo.ampool.monitorsleepinterval>
    </AppModuleConfig>
    </AppModuleConfigBag>
    <ConnectionDefinition name="xxx">
    <ENTRY name="JDBC_PORT" value="1521"/>
    <ENTRY name="ConnectionType" value="JDBC"/>
    <ENTRY name="HOSTNAME" value="xx.xx.xx.xx"/>
    <ENTRY name="DeployPassword" value="true"/>
    <ENTRY name="user" value="xxx"/>
    <ENTRY name="ConnectionName" value="xxx"/>
    <ENTRY name="SID" value="xxx"/>
    <ENTRY name="password">
    <![CDATA[{904}0505E5FED797881374FDE8BD1606B6CF01]]>
    </ENTRY>
    <ENTRY name="JdbcDriver" value="oracle.jdbc.driver.OracleDriver"/>
    <ENTRY name="ORACLE_JDBC_TYPE" value="thin"/>
    <ENTRY name="DeployPassword" value="true"/>
    </ConnectionDefinition>
    </BC4JConfig>
    and our jclient code to release connection like following:
    tabbedPane.addCloseListener(new CloseListener(){
    public void closeOperation(MouseEvent e){       
    cleanTabComponentListener(tabbedPane.getComponentAt(tabbedPane.getOverTabIndex()));
    tabbedPane.remove(tabbedPane.getOverTabIndex());
    UPanelBinding panelbd = tabbedPane.getPanelBinding();
    panelbd.releaseDataControl();
    panelbd.getBindingContext().release();
    }

  • Persist Database connection over user's session

    On portal 3.0.9 with JPDK v1 I have a web provider that has a jsp portlet. The portlet has multiple pages which are navigated useing a parameter specified with the pageParameterName tag in the provider.xml. Each page needs to be able to access the database and to allow a rollback for all a users actions until a certain page is visited I need a way for all the access to be done through one database connection.
    Putting the dbOpen tag in the event:session_OnStart tag of my globals.jsa file doesn't work (I'm not sure the event:session_OnStart is even executed) and trying to create the connection once with the scope="session" creates an error. Any help would be appreciated.

    Generally speaking, persisting a connection over a users session is a BAD idea. If you really need to do it you simply be able to add the Connection object to the session. However, I would strongly recommend that you review your model because it will not scale.

  • Multiple sessions in a single database connection.

    I have copied the following text from Forms Developer2000
    "At runtime, Form Builder automatically establishes and manages a single connection to ORACLE. By default, one user session is created for this connection. However, the multiple-sessioning feature of ORACLE allows a single client to establish multiple sessions within a single connection. ORACLE transaction-management and read-consistency features all are implemented at the session level, so creating multiple sessions allows a single user to have multiple, independent transactions."
    If ORACLE allows a single client to establish multiple sessions within a single connection, I want to leverage on this feature in my application which uses BC4J.
    Can anybody tell me if
    1. its possible achieve this in Java(BC4J).
    2. If Yes, How?
    regards,
    vikrant

    Thank you for your valuable suggestion.
    I believe createing multiple root Application
    Modules, will create as many number of connections to
    database, hence multiple transactions.
    But What I wanted was multiple sessions in a single
    connection, who's behavior will be similar to two
    different connections.Could you tell me the advantage you're looking for in multiple sessions in one connection vs. multiple connections (where connections may be pooled)?
    Thanks.
    Sung

  • Database connection pooling in ADF causing db procedure calls to use different transaction or session

    We have developed an application using JDev Version 11.1.2.1.0 and the database is oracle 11g EE.
    We have many database procedures or function calls from the model (AMImpl.java, VORowImpl.java) and the commit does not happen in the database and it happens from ADF. The database procedures are called in some valueChangeListnener and these procedures use the same transaction or session database session when called and update some records in some tables that are displayed in pages.
    We started using connection pooling recently in our ADF application,  -Djbo.doconnectionpooling=true -Djbo.txn.disconnect_level=1. When using connection pooling, we noticed that the database procedure calls use a different trasanction or different database session and the data or records that these procedures update is lost.
    After removing the connection pooling, we noticed that the procedures again started using the same transaction or same database session and was working fine.
    I want to know why this connnection pooling caused this issue and is there any fix for this when using connection pooling?

    Take a look at
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#CIHCHHEA
    What You May Need to Know About Database User State and jbo.doconnectionpooling = true
    As you can see:
    "At the end of the request when the application module is released back to the application module pool, that application module pool releases the JDBC connection it was using back to the database connection pool. It follows that with jbo.doconnectionpooling set to true the application module instance in the pool may have a completely different JDBC connection each time you check it out of the pool"
    So, the best you can do, is to revert jbo.doconnectionpooling to false.

  • ODI database connection - session question

    Hi,
    I have a package, where I have used a procedure.
    In my procedure, I open a database connection.
    My question is - In my next procedure - will I be able to use my same database connection which I created in previous step?
    Re-phrasing the question - for any number of database transaction happening in a package, will ODI opens multiple database connection per step or will there be only one single database connection?
    Thank you,
    Paras

    I believe its one per session so one connection inside the package. I think you should be , although i have not tried it practically.

  • How to use Session scope in jsp page

    Hello, I have login form, where user provides username and password. Then click on submit, it will forward to validation.jsp. Where it will check in database make sure username and password exit. Now i can also retrive accountid of perticular user. I want to put that username and accountid in session scope. so all other pages can use that username and accountid. How can i do that. I'm new at this, so please provide me example too. Here is my code for login.jsp and validation.jsp..
    Validation.jsp
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    //String name = request.getParameter( "username" );//
    //session.setAttribute( "accountID",accountID );//
    <%
    String connURL = "jdbc:oracle:thin:@orca.csc.ncsu.edu:1521:ORCL";
         Connection conn = null;
         Statement stmt = null;
         ResultSet rs = null;
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    conn = DriverManager.getConnection(connURL, "vapatel","pjdas");
    stmt = conn.createStatement();
    String user=request.getParameter("userName");
    String password=request.getParameter("password");
    boolean entrance=false;
    stmt.excuteQuery("SELECT AccountID From Password WHERE USERNAME='"+user+"'");
    rs = stmt.executeQuery("SELECT * FROM Password WHERE USERNAME='"+user+"' AND PASSWORD='"+password+"'");
    while(rs.next()){
    String dbUser = rs.getString("USERNAME");
    String dbPassword= rs.getString("PASSWORD");
    if ((user.equals(dbUser)) && (password.equals(dbPassword))){
    entrance=true;
    if (entrance==true){%>
    <jsp:forward page="form.jsp"/>
    <%}
    else{%>
    <jsp:forward page="login.jsp"/>
    <%}
    %>

    hi,
    to put something into session scope in a jsp page use:
    session.setAttribute("counter", Integer.toString(5));to retrieve is from a jsp page use:
    String counterAttribute = (String)session.getAttribute("counter");

  • When and How to close database connection in JSP?

    Hi there,
    I am using MySQL and JDBC 3.0, in my system, When and How to close database connection in JSP?
    Thanks in advance.
    Lonely Wolf
    <%@ page session="true" language="java" %>
    <jsp:include page="checkauthorization.jsp" />
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <%--
    Execute query, with wildcard characters added to the
    parameter values used in the search criteria
    --%>
    <sql:query var="availablecomputerList" dataSource="jdbc/Bookingcomputer" scope="request">
    SELECT * FROM computer where status=0
    order by s_code
    </sql:query>
    <html>
    <head>
    <title>Search Result</title>
    </head>
    <body bgcolor="white">
    <center>
    <form action="checkin.jsp" method="post">
    <input type="submit" value="Back to Check-in Page">
    </form>
    <c:choose>
    <c:when test="${availablecomputerList.rowCount == 0}">
    Sorry, no available computer found.
    </c:when>
    <c:otherwise>
    The following available computers were found:
    <table border="1">
    <th>Computer</th>
    <th>Description</th>
    <th>Status</th>
    <c:forEach items="${availablecomputerList.rows}" var="row">
    <tr>
    <td><c:out value="${row.s_code}" /></td>
    <td><c:out value="${row.description}" /></td>
    <td><c:out value="${row.status}" /></td>
    </tr>
    </c:forEach>
    </table>
    </c:otherwise>
    </c:choose>
    </center>
    </body>
    </html>

    when should you close the connection? when you're done with it.
    how should you close the connection? like this: conn.close();
    that said, doing this in a JSP page is bad form and not recommended
    JSP's typically don't contain ANY business or data logic

  • Keeping Database-Connection over several JSPs

    Hi all,
    when creating a database-connection (Oracle 8.x) with JDBC 2, Tomcat Engine, I encountered the problem, that the connection has been lost after forwarding to another JSP.
    What I read from some other forums, there seem to be 2 major ways of how to keep the connection:
    - session vars
    - connection pool
    I feel for our project session will be a approbiate solution, so can you tell me more about it (technical implementation)???
    Thanks & Rgds.,
    Rainer

    you have to declare a bean variable with session scope, like this:
    jsp:useBean     id="object-name"
         scope="session"
         type="type-of-object"     
         class="fully-qualified-classname"
         beanName="fully-qualified-beanName"
    />
    for more infos see (for example) http://www.stardeveloper.com/articles/display.html?article=2001072001&page=1

  • Stop App snooping through Session scope

    Right, haven't had to think about this too much before as I've always been working on projects on our own servers, but I'm now working on a project which will be hosted on a shared server. Irritatingly this brings me back to investigating Application scope snooping, and trying to find a way around it.
    And no don't even bother saying about a Multiserver install, I know that's for an ideal world but it's not the case here.
    Generally, I'd store my database connection details in the App scope, but obviously they can be read by other users on the box. I could wrap it up in a class, but even that can be executed by another app.
    I did, however, have a thought - what they *cannot* do is read my actual Application.cfc file. So how about I do something like this:
    <onAppStart>
      <cfset variables.secretkey =  '94yhf934h9p3v' />
      <cfset application.database.secretpassword = encrypt('mypassword', variables.secretkey , 'DESEDE') />
    </onAppStart>
    That way, the password is in the app scope (ie one place) but encrypted if anyone tries to look at it. I then do:
    <onSessionStart>
      <cfset session.database.secretpassword = decrypt(application.database.secretpassword , variables.secretkey, 'DESEDE') />
    </onSessionStart>
    Then in my code just reference session.database.secretpassword rather than the application-level version. That way nothing is visible in the Application scope, as it's all in the Session scope which other users cannot traverse. I know memory-wise it's not as efficient, but if it's the difference between giving away my database credentials and not, then I'm not overly fussed.
    Any issues anyone can see with that? Anything obvious I've missed? Any ways of improving it?
    Damn, I am ALL OVER these forums today.
    Cheers people
    O.

    What I mean is why an ISP would offer shared hosting instead of hosted VPSes.
    Well, working for an ISP, let me tell you
    Maintainability and resource. One standalone machine with 4GB of RAM and a quad-core CPU can happily run 500 CF websites as a shared server setup. There's simply no way that machine could run 500 VPS servers, all with their individual memory, CPU and disk overheads from both CF and the OS.
    You also would need to do 500 CF installations. Yes, you can deploy from archives or whatever but it's still a significant time and effort. Once done, you have 500 different CF installations you have to patch when Adobe release a hotfix or a new version. You have 500 lots of Windows Updates to do. 500 backups to configure to 500 iSCSI drives.
    And all for £50 a year per customer? Not a chance. That's the very nature of shared hosting; it's quite incredible value when you consider what (can) be included. I know many hosts don't, but we run ColdFusion Enterprise with sandbox security on SAS-based 64-bit servers, and all for £50 a year upwards. When you look into the costs of doing it yourself, it's a simple no-brainer.
    Incidentally for our own benefit we are now splitting machines to an extent - each physical server now runs VMware ESXi, onto which we install four or five virtual machines, each running Windows and ColdFusion. So to a degree we're splitting them up, but that's more for our own benefit - if a customer brings down a server, it affects only a quarter of the customers it would have. If we need to reboot a box for updates, the same. Also virtual machines are far quicker to reboot, another benefit for us.
    But as for running a VPS per customer on shared hosting - forget it. Never going to happen

  • Database connection closing in JSF

    This is regarding Database connection closing in JSF.
    in servlets we have destroy method where we will be closing the database connections, similarly in JSF where should we close the database connections? is it taken care by the framework?
    is there a way where we could capture the end of session and then close the database connection?
    I am creating database connection in backing bean as I am not supposed to create a pool of connection objects(I am using tomcat 5.5)
    Thanks in advance for any suggestions about this.

    k_srinivas wrote:
    This is regarding Database connection closing in JSF.OK.
    in servlets we have destroy method where we will be closing the database connectionsThis is at its own already a very bad practice. All database resources like Connection, Statement and ResultSet must be acquired and closed in the shortest possible scope. You should never keep them open as an instance variable and for sure not in a servlet (which lives as long as the application lives). If you keep a connection open that long, it will timeout sooner or later and your application will crash.
    , similarly in JSF where should we close the database connections? is it taken care by the framework?
    is there a way where we could capture the end of session and then close the database connection?No, just acquire and close the resources in the shortest possible scope. To improve performance, introduce connection pooling. But this doesn't mean that you can write the JDBC code the other way. You still need to acquire and close the resources quickly. The connection pooling implementation will worry about actually closing the connection or releasing the connection to the pool.
    I am creating database connection in backing bean as I am not supposed to create a pool of connection objects(I am using tomcat 5.5)
    Thanks in advance for any suggestions about this.This makes no sense. Just make use of Tomcat's own connection pooling facility.
    For more about doing the database access logic the proper way, you may find this tutorial useful: [http://balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html].

  • THE DATABASE CONNECTION IS LOST :;; WIERD  ORA-01012 NOT LOGGED ON ERROR

    ERROR: ORA-01012 NOT LOGGED ON ERROR
    I AM USING A JAVA SWING INTERFACE (JDK 1.1.8), WHICH USES JNI TO CALL C PROGRAMS WHICH IN TURN CONNECTS TO THE DATABASE, ORACLE 8.1.6.
    A DATABASE CONNECTION IS ESTABLISED IN THE MAIN CLASS BY CALLING A FUNCTION FROM THE CONSTRUCTOR.
    FOR ALL OTHER FUNCTION CALLS WHICH ARE MADE FROM WITHIN THIS CONSTRUCTOR, THE CONNECTION STAYS.
    BUT AFTER THE CONTRUCTOR CALL IS COMPLETE, DATABASE CONNECTION IS STRANGELY LOST. THUS ALL OTHER FUNCTION CALLS FAIL BECAUSE OF CONNECTION ISSUES GIVING ORA-01012. THOUGH IF I CHECK UP IN THE DATABASE, THE CONNECTION DOES FIND AN ENTRY.
    SO IT APPEARS THAT SOMEHOW THE JAVA INTERFACE LOOSES TRACK OF CONNECTION. BUT STRANGELY ALL THE FUNCTIONS WORK IF CALLED FROM THE CONSTRUCTOR......... BUT THATS NOT THE IDEA.
    PLEASE HELP, THIS PROBLEM IS BUGGING ME FOR WEEKS NOW.
    THANKS
    AMIT

    apologise for the caps lock.
    i am working on a previous system with java swing front end which alread uses jni, and connects to database using pro *c.
    My problem is that the connection is lost as soon as the constructor of the main class is run, giving an
    ORA-1012 NOT LOGGED ON ERROR.
    But if i place the same calls in the contructor all the database call work.
    It somehow appears that the java interface looses the connection context. Though the session does find entry in the oracle dynamic tables as long as i dont close the front end main window, thereby meaning that its the jave interface which looses the context.
    part of the code of the main class eiquser.
    //constructor
    public EiqUser() {
         super();
         initMRI();
    private void initMRI() {
         try {
              /* initialize geoManager environment */
              int rccc = new EiqCfuncs().eiqInitEnv();
    //eiqinitenv is a c function which connects to database using pro *C
              EiqCfuncs cfuncs = new EiqCfuncs();
              //EiqCfuncs has the prototypes of c functions used bye the java interface
              this.ivjFileMenu.setText(cfuncs.eiqGetText(resNum.getTEXT_FILE_MENU())); // sets the menu name
    and so on.........
    public void eiqUser_WindowClosed(java.awt.event.WindowEvent windowEvent) {
         new EiqCfuncs().eiqTermEnv(); // gives ora-1012 error
    //eiqtermenv is supposed to disconnect from data base, but returns an ora-1012 not logged on erro
         return;
    //eiqtermenv closes the connection with the data base. But fails in this case. if i place the same call ( eiqtermenv) in the initMRI function or the contructor it succeeds.
    Plus if i dont use the java interace and use a c stub for executing the same sequence of functions, then i dont face any problems.
    the proc calls exectuted ultimately by...
    :::eiqinitenv
    exec sql connect using :sqlid identified by sqlpw; // succeeds giving sqlerr.sqlcode=0;
    ::::eiqterm env
    exec sql commit work; //fails giving 0ra-1012 error
    exec sql rollback work;
    Why is the java interface loosing track of the connection once done with the constructor of the main class?? The session still finds an entry in the oracle dynamic tables.
    Please help
    Thx
    Amit

  • MySQL Database Connection (two databases at the same time)

    I have never had to open more than one MySQL database from within the same website before, but I do now.  The website I have is designed where all the content comes from within the main database.  I am building an Inventory system that I want within it's own database, in the event I would ever need to move the application to another server or something, I don't want this data residing in the main database.
    Currently, I open the database connection from within a file called "common.php" that resides in a directory called "lib" that can be accessed from the root directory.  Below is the proposed code that would be placed within the "common.php" file:
    // Define Database Variables
    $dbserver = "127.0.0.1";
    $dbuser  = array('clevelan_user1', 'clevelan_user2');
    $dbpass  = array('P@ssw0rd', 'P@ssw0rd2');
    $dbname  = array('clevelan_database1', 'clevelan_database2');
    // Start Session
    session_start();
    // Connect to Databases
    connectdb($dbserver, $dbuser[0], $dbpass[0], $dbname[0]);
    connectdb2($dbserver, $dbuser[1], $dbpass[1], $dbname[1]);
    // Database 1 Connection
    function connectdb($dbserver, $dbuser, $dbpass, $dbname) {
    // connects to db
      global $connection;
      $connection = @mysql_connect($dbserver, $dbuser, $dbpass) or die ("could not connect to server");
      $db = @mysql_select_db($dbname, $connection) or die ("could not select databsase");
      return $connection;
    // Database 2 Connection
    function connectdb2($dbserver, $dbuser, $dbpass, $dbname) {
    // connects to db
      global $connection2;
      $connection2 = @mysql_connect($dbserver, $dbuser, $dbpass) or die ("could not connect to server");
      $db2 = @mysql_select_db($dbname, $connection2) or die ("could not select databsase");
      return $connection2;
    //End of Code Within the "common.php"
    From within any page of the website, I want to access both connections by placing an include at the top of each page:
    include_once("lib/common.php");
    Currently, when I run the code above, any page within the website (the home page) provides error messages with regards to database connectivity (the pages are looking for there content from within the second database.  It's as if the second database is the only database seen by the website.
    I need help figuring out how I can have two MySQL databases open at the same time (the second database will only be open for short periods of time and then closed).  But the main database is always open.

    Create one project using one copy of the exact tables.
    create 2 different sessions.xml files each pointing to the same project. Set the login information in the sessions.xml files.
    That should work fine.
    Peter

  • Crystal Report Viewer Not Releasing Oracle Database Connections

    I have a very simple vb.net 3.5 web application that uses the Crystal Report viewer 2008 to open a report. My requirements are as follows:
    1. Reports are built by another company and provided to us and used in a web environment
    2. All reports contain parameter fields
    3. The web application must be generic enough that a report can be added to a list and the user simply selects the report and provides database login information. The Crystal report viewer with handle the request for parameter values and prompt the user for their values.
    4. All reports connect to an Oracle 10g server.
    The above requirements have been meet and we have an extremely simple web application that runs the reports. It is working very well other than the crystal report viewer is not releasing the database connections. This is bad because the credentials are on a per user basis and that same user must login to a different oracle application simultaneously. They are being denied access because the credentials are already in use. We do not have control nor influence over the policies in use on the Oracle server. Ideally we would like to control the Crystal Report viewer so that it closes connections after use.
    The web application code is:
    Private Sub viewReports_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    If Not IsPostBack Then
    ConfigureCrystalReport()
    End If
    End Sub
    Private Sub ConfigureCrystalReport()
    'Load the Crystal Report viewer with a report.
    Try
    Dim reportPath As String = Server.MapPath(Session("reportname"))
    crViewer.ReportSource = reportPath
    Catch ex As Exception
    Response.Write(Server.MapPath(Session("reportname")) & "
    " & ex.Message.ToString & "
    " & ex.StackTrace.ToString)
    End Try
    End Sub
    Can anyone shed some light on this topic? Thank you

    Hello, Timothy;
    By default, having the report in session will hold it open for 20 minutes.
    If you create the report as a ReportDocument object you can take it out of session and release it more efficiently. That will release the connection.
        Private Sub ConfigureCrystalReports()
            If (Session("hierarchicalGroupingReport") Is Nothing) Then
                hierarchicalGroupingReport = New ReportDocument()
                hierarchicalGroupingReport.Load(Server.MapPath("Hierarchical Grouping.rpt"))
                Session("hierarchicalGroupingReport") = hierarchicalGroupingReport
            Else
                hierarchicalGroupingReport = CType(Session("hierarchicalGroupingReport"), ReportDocument)
            End If
            myCrystalReportViewer.ReportSource = hierarchicalGroupingReport
        End Sub
    In the Form Unload of the Viewer:
                'Take the report out of session
                Session("hierarchicalGroupingReport")  = Nothing
                Session.Contents.Remove("hierarchicalGroupingReport")
                'Clean up the ReportDocument object
                hierarchicalGroupingReport.Close
                hierarchicalGroupingReport.Dispose()
                hierarchicalGroupingReport = Nothing
                GC.Collect()
    Elaine

  • Database connection in EJB

    Hi,
    I am using a method for validating Userid and Password in a Session Bean. I could deploy and run it without any errors but the return value is null. The same bean If I am using with <JSP:usebean> tag the return value is correct. That means the database connection is OK. I am giving the code below.
    public String validate(String UId,String PWd)throws RemoteException {
    try{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection("jdbc:oracle:oci8:scott/tiger@Everest");
    st = conn.createStatement();
    String str = "select * from T_CRM_WRK_LCTN where LOGINID='"+UId+"'";
    ResultSet rs = st.executeQuery(str);
    while(rs.next()){
    login = (String) rs.getString("LOGINID");
    if(login.equals(UId)){
    pass = (String) rs.getString("PASSWORD");
    break;
    if( (UId.equals(login)) && (PWd.equals(pass)))
    flg="Y";
    else
    flg="N";
    st.close();
    conn.close();
    }catch(Exception e){}
    return flg;
    Can anyone help me what is the problem. Thanks in advance.
    Mallik
    null

    Hi,
    Extension to the above problem, the problem is with the Connection. It is not able to establish the connection. Can anyone advise me about the possible reasons.
    Mallik

Maybe you are looking for

  • Solman 4 SR3 MOPZ issue

    Did a fresh Solman 4 SR3 install. Completed the post install config. Cannot activate OSS connection yet due to firewall rules. Two issues: 1) when doing the Part II config wizard step, an error occurs and the config step terminates. Nothing in the sy

  • Customize Export template

    Hi, I would like to generate a Outlook Calendar file (.vsc, plain text) from HTMLDB. I think the "Export CSV File" template is an easy way to try. I know we can add a HTML region for customized text from the follow thread: Add text to downloaded CSV

  • How to fix for maximizing minimizing frames when screen resolution changes

    Hi, all I guess this must be an old question, but please help me. Thanks

  • Replace org_organization_definitions with mtl_parameters

    Hi, I need to replace org_organization_Definitions with mtl_parameters for performance reasons.. But as I see that OOD is a view and has some security applied through hr_organization_units, I doubt if I can directly replace OOD with MP as follows: Ol

  • ITunes on two computers - keeping ratings and file info in synch?

    I have my iTunes files on two computers (and thus have used two of the 10 that I am permitted). When I rate a file on one computer, or change the info (to add genre or artist info) on one computer, how can I can duplicate it on the second computer? I