Re: JSP Database connectivity

Hello,
My web application set up in following way;
Application --> Hibernate --> Proxool (proxool.sourceforge.net) ---> Database (postgresql)
and i got 15 max connection open on proxool
and 15 max connection open at postgrest database,
Time to time, im getting failed: FATAL: connection limit exceeded error.
What would be the best solution for this other than increasing the both database and proxool connections?
application send a sql request to thread and thread wait till, next avelable connection?
something easy to set up within hibernate or proxool?
or am i missing something/
other wise im not sure when is the MAX connection to be..15 to .... what ?
Please give me some advice or should i use different connection pooling other than proxool?
or any other way to queue the connection other than use through thrads

Why shouldn't you...
Just find the right driver, if you don't have it already, and set up the ODBC source.
/Rickard

Similar Messages

  • Jsp-database connectivity problem

    hi
    There is a problem, when ever i write a jdbc code for database connectivity through MsAcess, in general applications it works fine. But when ever i try to the same using Jsps it throws an exception that " Microsoft jdbc-odbc driver not fount, Default driver not specified"
    please do help regarding this
    the code i used is
    package Products; import java.sql.*;import java.util.*; public class product{          public Vector getCategories()     {          Connection con;          Statement st;          ResultSet rs;          Vector ret=new Vector(1,1);          try          {               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");               con=DriverManager.getConnection("jdbc:odbc:Web");               st=con.createStatement();               rs=st.executeQuery("Select * from Categories");               while(rs.next())               {                         ret.add(rs.getString(2));                    );               }          }          catch(Exception e)          {               //System.out.println("Exception...");               ret.add(e.getMessage());          }          return ret;     }}

    Have you downloaded the driver and put it in your Web-Server?
    In tomcat you simply need to copy the file in:
    Tomcat 5.0\common\lib

  • Jsp database connectivity

    To maintain the database connectivity, we are trying to keep the database 'Connection' in the session object (putValue, getValue). Do anybody see any problem with there? Any comment appreciated.
    Thanks.

    Your suggestion is a simple way to avoid reopening the db connection for the same user. It will work, if the number of concurrent users is not that big. If the number of concurrent users is very big, connection pool would be needed.
    You may want to take a look into HttpSessionEventListener. If your db connection is "unbound" from the session, you may want to close the connection. Otherwise, you will reach the max number of connection very soon.
    null

  • Oracle Single Sign on JSP Database Connection

    I am writing a JSP Search Screen that launches off of Oracle Portal (behind SSO). What I'm looking to do is have the JSP connect to the database as that user, and then show the information available to that user (we have this handled by a VPD). I was wondering how I could get access to the single signon RAD in order to connect to the database from within my JSP. Any help would be greatly appreciated.

    Hi Darsh,
    1. Oracle Internet Directory (OID) is Oracle LDAP storage solution (more here), Oracle Virtual Directory is Oracle solution that can read identity data (and filter it (mask it) based on policies) from Oracle/non-Oracle databases, Oracle/non-Oracle Directories and files and provide the user profiles as LDAP view (more here), There is nothing called Oracle Active Directory, you must be referring to Microsoft Active Directory.
    2. No, Oracle Single Sign On (OSSO) is a feature in iAS (its obsolete), Identity Management is wide umbrella of solutions and concepts.
    3. Oracle Access Manager is one component of Oracle Identity and Access Management suite of products.
    4. Webgate is Oracle access Manager agent that is installed on a webtier, it intercepts the web requests and collect the credentails, send them to Oracle Access Manager for security evaluation (decide what Authentication is needed, verify collect credentials, etc), webgate then enforce the Access Manager decision.
    5. Oracle EBS AccessGate is a java application that has the same use of OAM Webgate (it is OAM agent) but specific to E Business suite, EBS Access Gate is the new solution replacing OSSO agents, OAM is replacing OSSO server component, EBS and OSSO customers can use OAM server with OSSO agents, or with EBS AccessGate.
    HTH.
    Ghassan

  • Open and close database connection jsp page

    hi there, i wanna know about how to open database connection to Mysql at the beginning of the page and close the connection at the end of the page. The jsp page contain all processing code.
    plz help me...thx thx

    <html>
    <head>
    <basefont face="Arial">
    </head>
    <body>
    <%@ page language="java" import="java.sql.*" %>
    <%!
    // define variables
    String id;
    String firstName;
    String lastName;
    // define database parameters, change this according to your needs
    String host="localhost";
    String user="root";
    String pass="";
    String db="test";
    String conn;
    %>
    <table border="1" cellspacing="1" cellpadding="5">
    <tr>
    <td><b>id</b></td>
    <td><b>first name</b></td>
    <td><b>last name</b></td>
    </tr>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    // create connection string
    conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user 
    + "&password=" + pass;
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(conn);
    // query statement
    Statement SQLStatement = Conn.createStatement();
    // generate query
    // change this query according to your needs
    String Query = "SELECT id, firstname, lastname FROM abook";
    // get result
    ResultSet SQLResult = SQLStatement.executeQuery(Query);
    while(SQLResult.next())
       id = SQLResult.getString("id");
       firstName = SQLResult.getString("firstname");
       lastName = SQLResult.getString("lastname");
            out.println("<tr><td>" + id + "</td><td>" + 
         firstName + "</td><td>" + lastName + "</td></tr>");
    // close connection
    SQLResult.close();
    SQLStatement.close();
    Conn.close();
    %>
    </table>
    </body>
    </html>hi :-)
    i've got that on the net as part of the tutorial on jsp (long long time ago)
    you just have to be resourceful in finding solutions :-)
    try google :-) there are lot's of tutorial available in there ;-)
    goodluck ;-)
    regards,

  • 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

  • How to establish a MYSQL Database connection in JSP page.

    Hi People,
    Tell me how to establish mysql database connection in JSP page.
    Needed details on:
    1) what are all the mysql drivers need to be included.
    2) what is the syntax for establish a database connection

    hi,
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.htmlsee down for mysql config with tomcat

  • Problem in Oracle Database Connectivity in JSP

    I am having big problem such as Oracle Database connectivity problem
    Following code i am used for database connection. but it throw an exception call class not found exception.
    Pls any one can help me. With a sample code for Oracle Database connection in JSP
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    String url="jdbc:oracle:thin:@172.25.44.54:1521:bbo";
    con = DriverManager.getConnection(url,"user", "user123");
    Thank you

    Well i've never used oracle or their drivers before but i'm presuming that you'd go to oracle.com or something and look for downloads. Otherwise you could goodle for Oracle JDBC drivers. Then just follow the instructions.
    Again i've never used JSP but if you have a manifest file somewhere you'll need to put a class-path: entry in their referecning the jar file with the driver so that it is availble at run-time.
    Wes

  • DATABASE CONNECTIVITY PROBLEM IN JSP

    Hello Friends .
    I am facing problem in database connectivity with JSP . Following is the code .
    <%
    String accessDBURLPrefix = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    String accessDBURLSuffix = ";DriverID=22;READONLY=false}";
    String databaseURL = accessDBURLPrefix + "db1.mdb" + accessDBURLSuffix;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    java.sql.Connection con = java.sql.DriverManager.getConnection(databaseURL, "", "");
    out.println("Connection created sucessfully");
    catch(Exception e)
    out.println(e);
    %>
    It gives following output :
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
    If I run the code in core java application then it works sucessfully .
    Plz help me to find the solution .
    I am using sun studio Enterprise 8.1
    have stored the access file in web direcotry in the project.
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Please use CODE tags when posting code. You are losing some of the plus signs of string concatenation to the forum's formatting beast.
    Preferred solution: Don't use Access as a database. The JDBC-ODBC bridge is always troublesome.
    If you must use Access...
    Well the message is easy enough to understand: it can't find the database db1.mdb.
    You say you put db1.mdb in the web directory. Obviously the computer is not looking there (silly computer for not looking where you put the file)
    So it is up to you to be smart and tell the computer exactly where to go.
    Using application.getRealPath("/db1.mdb") in place of "db1.mdb" will probably work in a JSP.
    String databaseURL = accessDBURLPrefix  + application.getRealPath("/db1.mdb") +  accessDBURLSuffix;cheers,
    evnafets

  • Configuring database connection (metadata repository) from jsp

    anybody could help me to configuring database connection from portal schema from jsp page.
    i dont have idea.
    Thanks.

    Hi,
    You won't be able to access the DB connections used by iAS from the JSP. As these connections are managed by mod_plsql component in iAS.
    Thanks,
    Ved

  • Using JSP to connect to an Access Database

    I need help on using JSP to connect to an Access database.
    This is the code I currently have connecting to a mySQL DB. I need to change it to connect to an Access DB. The reason I am switching DB's is because mySQL is no longer going to be carried by my host.
    Here is the code:
    <html>
    <head>
    <basefont face="Arial">
    </head>
    <body>
    <%@ page language="java" import="java.sql.*" %>
    <%!
    // define variables
    String UId;
    String FName;
    String LName;
    // define database parameters
    String host="localhost";
    String user="us867";
    String pass="jsf84d";
    String db="db876";
    String conn;
    %>
    <table border="2" cellspacing="2" cellpadding="5">
    <tr>
    <td><b>Owner</b></td>
    <td><b>First name</b></td>
    <td><b>Last name</b></td>
    </tr>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    // create connection string
    conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user + "&password=" +
    pass;
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(conn);
    // query statement
    Statement SQLStatement = Conn.createStatement();
    // generate query
    String Query = "SELECT uid, fname, lname FROM abook";
    // get result
    ResultSet SQLResult = SQLStatement.executeQuery(Query);
         while(SQLResult.next())
              UId = SQLResult.getString("uid");
              FName = SQLResult.getString("fname");
              LName = SQLResult.getString("lname");
              out.println("<tr><td>" + UId + "</td><td>" + FName + "</td><td>" + LName
    + "</td></tr>");
    // close connection
    SQLResult.close();
    SQLStatement.close();
    Conn.close();
    %>
    </table>
    </body>
    </html>
    Thank You,
    Josh

    <%@ page language="java"%>
    <html>
    <head>
    <title>
    First Bean
    </title>
    <%@ page import="java.sql.*" %>
    </head>
    <body>
    <p>
    <%!
    Connection con;
    Statement st;
    ResultSet rs;
    String userid;
    String password;
    %>
    <%!public void db(JspWriter out)
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:phani");
    catch(Exception e){}
    try{
    st=con.createStatement();
    rs=st.executeQuery("SELECT * FROM login");
    while(rs.next())
    userid=rs.getString("userid");
    password=rs.getString("password");
    out.println(userid);
    out.println("</br>");
    out.println(password);
         out.println("</br>");     
    }catch(Exception e){}
    try{
    con.close();
    }catch(Exception e){}
    %>
    <%db(out);%>
    </p>
    </body>
    </html>
    phani is dsn name
    login is table name
    Good luck
    phani

  • Database Connection Problem, JSP, Tomcat5.5.9, Oracle9i

    hi,
    Am trying to make database connection using Oracle9i thin driver, what am doing is:
    I put classes12.zip and classes12_dms.jar in the classpath and also added these libraries in netbeans library folder.
    I make jsp page like this --------
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.util.*, java.sql.*"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Testing Page</title>
    </head>
    <body>
    <%
    String url = "jdbc:oracle:thin:@SERVERNAME:1521:DBNAME";
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection(url,"scott","tiger");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select * from person order by name");
    %>
    <h1>Testing Page</h1><hr>
    <table border="1">
    <tbody>
    <tr>
    <th>Name</th>
    <th>Email</th>
    </tr>
    <% while(rs.next()) {%>
    <tr>
    <td><%= rs.getString(1)%></td>
    <td><%= rs.getString(2)%></td>
    </tr>
    <%
    rs.close();
    stmt.close();
    conn.close();
    } catch(ClassNotFoundException CNFEx) {
    out.println("<b>Error !</b><br>" + CNFEx.getMessage());
    } catch(Exception Ex) {
    out.println("<b>Error !</b><br>" + Ex.getMessage());
    %>
    </tbody>
    </table>
    </body>
    </html>
    when I run this page i got this error messages ----
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
    org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:138)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    root cause
    java.lang.NoClassDefFoundError
    oracle.jdbc.driver.OracleConnection.createDMSSensors(OracleConnection.java:506)
    oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:330)
    oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:485)
    oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:337)
    java.sql.DriverManager.getConnection(Unknown Source)
    java.sql.DriverManager.getConnection(Unknown Source)
    org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:79)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    any kind of help is appericiable.
    thanks.....

    I'd start by checking for a more recent driver version on Oracle's web site.
    Or: googling for "createDMSSensors" (the "root cause" in the stack trace) has as the first hit: Re: Java Help Please! HttpServlet doFilter() Exception

  • 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

  • Jsp and database connection using bean

    * I want create a bean to handle database connectivity.The
              <jsp:usebean> tag uses
              no argument constructor ..so I cannot pass the userid and password to
              the constructor.
              So how can I create a database connection when the user_id and password
              will be a part of parameter ?
              * Now I'm opening database connection in the jsp scriplets. Everytime I
              refresh the
              jsp page a new connection is created ? Is it not going to choke the
              database ? I cannot use connection pool because every user logs in with
              different userid.
              Thanks
              

    You can pass your arguments in this way:
              <jsp:usebean id="myBean" scope="page"/>
              <jsp:setProperty name="myBean" property="userId", value=<%= user_id%>/>
              <jsp:setProperty name="myBean" property="password", value=<%=
              user_password%>/>
              of course, in your bean class, you should create two setter methods,
              setUserId and setPassword.
              Hopefully, this will help you.
              sonia WEN
              Chiranjib Misra wrote:
              > * I want create a bean to handle database connectivity.The
              > <jsp:usebean> tag uses
              > no argument constructor ..so I cannot pass the userid and password to
              > the constructor.
              > So how can I create a database connection when the user_id and password
              > will be a part of parameter ?
              >
              > * Now I'm opening database connection in the jsp scriplets. Everytime I
              > refresh the
              > jsp page a new connection is created ? Is it not going to choke the
              > database ? I cannot use connection pool because every user logs in with
              > different userid.
              >
              > Thanks
              

  • Jsp JST MySQL - database connection

    Hello
    I am facing a database connection problem. I want to connect to mysql database fro a jsp page that uses JSTL taglibs.
    I am using Tomcat 5.x, JSTL 1.1. MySQL 5x
    I have copied jstl.jar, standard.jar and mysql driver in the \WEB-INF\lib dir of my application.
    If I connect to the database using scriptlet it works. But If I connect using the sql taglib, it gives me the error
    2008-01-22 14:20:12 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
    my jsp file is as follows
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <c:set var="firstName">request.getParameter("name")</c:set>;
    <%= request.getParameter("name") %>
    <sql:setDataSource
    var="myDS"
    scope="request"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/contact_db"
    user="root"
    password=""
    />
    <sql:query var="phone_book" dataSource="$(myDS)">
    Select last_name, home, cell, office from phone_book where first_name = ?
    <sql:param value="firstName"/>
    </sql:query>
    <HTML>

    hi thanks
    please let me know whats the better approach for getting an database connection if this is not recommended.
    after some modifications i am not getting the no suitable driver error. I also updated the code as per your comments. ...yet am not seeing any results.
    I have modified the file as follows.
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%
    String firstName = request.getParameter("name");
    %>
    <%= firstName %>
    <sql:setDataSource
    var = "firstDS"
    scope="request"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/contact_db"
    user="root"
    password=""
    />
    <sql:query var="phone_book" dataSource="${firstDS}">
         Select * from phone_book where first_name = ?
         <sql:param value="${firstName}"/>
    </sql:query>
    <c:forEach var="phone_book" items="${user.rows}">
         <tr>
    <td><c:out value="${row.no}"/></td>
    <td><c:out value="${row.first_name}"/></td>
    <td><c:out value="${row.last_title}"/></td>
    <td><c:out value="${row.home}"/></td>
    <td><c:out value="${row.cell}"/></td>
    <td><c:out value="${row.office}"/></td>
    </tr>
    </c:forEach>
    <HTML>
    <BODY>
         Hello
    </BODY>
    </HTML>

Maybe you are looking for

  • HELP ME! Nokia 5230 does not work after update

    My nokia 5230 will not boot after update. I've also tried everything and red green camera button intedruken but nothing worked. Can someone help me I am so on vacation. Sorry for my English I am Dutch

  • SVG saved in Illustrator won't show up on Chrome and is blowing up on Safari

    Hello. First time here, so bear with me in case I'm doing something wrong. So, I have to create almost 500 maps for this wine store website. They want the maps to be SVG files, because their website is responsive, so SVG would be the format that goes

  • ITunes not recognizing iPod Classic

    Ok, so this post is going to be a little long since I need to explain what is happening with my iPod Classic 160gb. I noticed a few days ago that songs were 'disappearing' on my iPod when I would listen to it through iTunes on my computer (When I say

  • Data Page Wizards

    Jdeveloper 3.2.3 - windows 2000 Oracle 8.1.7 I have used the Data Page Wizards to create a query, edit and insert forms. The forms are generated using the jbo: datatags. I would like to implement the following: 1. Query submit screen(hitlist) Current

  • [SOLVED] ldconfig: /usr/lib/libOpenCL.so.1 is not a symbolic link

    Hi. I use 64 bits arch with gnome and the ATI driver 13.6 beta installed from the AMD binary and I usually execute steam. Everything seem fine, but recently I receive a message when I update any package with pacman ldconfig: /usr/lib/libOpenCL.so.1 i