Sure it possible. For the page for example, at least you can do is
use 
-----------------------------------------------------------------------
<%@ page import="java.sql.*" %>
<%!
    Connection conn;
    PreparedStatement stmt;
%>

<%!
    public void jspInit() {
        try {
            String url  = "jdbc:as400://URLHERE";
            String id   = "id";
            String pass = "pass";
            
            /* Making a sql string */
            String sql = "SELECT xxx FROM yyy WHERE xxx = '?'";
                
            Class.forName("com.ibm.as400.access.AS400JDBCDriver");
            conn = DriverManager.getConnection(url, id, pass);
            stmt = conn.prepareStatement(sql);
        } catch(SQLException e) {
            e.printStackTrace();
        } catch(ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
%>

<%!
/* To close all connections when JSP is destroyed (reloaded, etc) */
    public void jspDestroy() {
        try {
            stmt.close();
            conn.close();
        } catch(SQLException e) {
            e.printStackTrace();
        }
    }
%>
---------------------------------------------------------------------

Then you can use something like  (not tested of course)
---------------------------------------------------------------------
          String email = request.getParameter("email");
        stmt.setString(1, email);
        ResultSet rset = stmt.executeQuery();

---------------------------------------------------------------------

But this is for some easy pages. If you want to driver "Yahoo" on it,
it wouldn't help... I will suggest you to take a look at PoolMan JDBC
connection pool. It works nicely here...

John.















>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 2/5/01, 1:18:36 PM, "John Coonrod" <[EMAIL PROTECTED]> wrote regarding Speeding 
up database accesses:


> I would like to leave my oracle database connection open from one page to
> another within a session - is that possible? Is it possible to pool one
> connection for the entire webserver? If so, how? Thanks.


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

NOTICE:  This communication may contain confidential or other privileged information.  
If you are not the intended recipient, or believe that you have received this 
communication in error, please do not print, copy, retransmit, disseminate, or 
otherwise use the information.  Also, please indicate to the sender that you have 
received this email in error, and delete the copy you received.  Any communication 
that does not relate to official Columbia business is that of the sender and is 
neither given nor endorsed by Columbia.  Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to