Immediate HELP in Tomcat 5 to Postgresql 7.4 database connectivity problem

Hi,
I failed to connect Tomcat 5.0.24 with Postgresql
7.4.2. The files created by me and the changes i had
made in the existing files are rates.jsp,
conversionDAO.java, web.xml and server.xml. The error
message on the top of the rest of it was "The value of
useBean class attribute converter.conversionDAO is
invalid". So far I found out that the coding for
database connectivity purpose in conversionDAO.java
cause the error. Another thing is Postgresql jdbc
driver is required to set in the CLASSPATH for the
java file to access the Postgresql database. I don't
know where should I put it in Tomcat for web
application. Anyway, I put it in
$CATALINA_HOME/shared/lib according the book i
refered. I do the database connectivity coding refer
to the Tomcat Kick Start book from Sams Publishing.
Below are the coding involved, please show me the
mistake i had made. Thank you.
----server.xml----
<Context path="/database"
docBase="${catalina.home}/webapps/database" debug="0"
reload="true">
<ResourceParams name="jdbc/conversion">
<parameter>
<name>username</name>
<value>myusername</value>
</parameter>
<parameter>
<name>password</name>
<value>mypassword</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.postgresql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:postgresql://localhost/conversion</value>
</parameter>
</ResourceParams>
</Context>
----web.xml----
<servlet>
<servlet-name>conversionDAO</servlet-name>
<servlet-class>converters.conversionDAO</servlet-class>
</servlet>
<resource-ref>
<res-ref-name>jdbc/conversion</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
----conversionDAO.java----
public conversionDAO() throws SQLException,
NamingException
Context init = new InitialContext();
Context ctx = (Context)
init.lookup("java:comp/env");
DataSource ds = (DataSource)
ctx.lookup("jdbc/conversion");
con = ds.getConnection();
select = con.prepareStatement(
"SELECT rate FROM Exchange WHERE src= ? AND dst =

Immediate HELP in Tomcat 5 to Postgresql 7.4 database connectivity problem (cont.)
Errors log
2004-06-06 01:07:53 StandardContext[servlets-examples]SessionListener: contextDestroyed()
2004-06-06 01:07:53 StandardContext[servlets-examples]ContextListener: contextDestroyed()
2004-06-06 01:07:53 StandardContext[jsp-examples]SessionListener: contextDestroyed()
2004-06-06 01:07:53 StandardContext[jsp-examples]ContextListener: contextDestroyed()
2004-06-06 01:07:59 StandardContext[balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2004-06-06 01:08:00 StandardContext[jsp-examples]ContextListener: contextInitialized()
2004-06-06 01:08:00 StandardContext[jsp-examples]SessionListener: contextInitialized()
2004-06-06 01:08:00 StandardContext[servlets-examples]ContextListener: contextInitialized()
2004-06-06 01:08:00 StandardContext[servlets-examples]SessionListener: contextInitialized()
2004-06-06 01:08:01 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /rates/rates.jsp(5,0) The value for the useBean class attribute converters.conversionDAO is invalid.
     at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
     at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:357)
     at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:141)
     at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1217)
     at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
     at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
     at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
     at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
     at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
     at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
     at org.apache.jasper.compiler.Generator.generate(Generator.java:3261)
     at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
     at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
----more----

Similar Messages

  • Please Help me in Labview and MS Access Database Connective

    Please Help me in LabVIEW and MS Access Database Connective through an example . I am new to LabVIEW .I need simple example that take a data from a table and display it on front panel .
    thanks in advance .

    duplicate post

  • Database Connection problem (JSP, Oracle & Tomcat 5.5)

    I am trying connect to Oracle 8 database through JSP and the webserver is Tomcat5.5. The classes.jar file is in the Tomcat5.5\common\lib directory and the path has also been set to mentioned directory. But I am getting exceptions. The code and the error are given below.
    Need help at the earliest.
    Thanks in advance.
    CODE
    Class.forName ("oracle.jdbc.driver.OracleDriver");     
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@insrs013:1521:GCR","BILLING_USER", "BILLING_USER");
    PreparedStatement pstmt = null;
    ResultSet rs = null;     
    pstmt = con.prepareStatement("INSERT INTO PROJECTIP(PROJECTID, PROJECTSERVERNAME, SERVERIP) VALUES(?,?,?)");
    ERROR
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: oracle.jdbc.driver.OracleDriver
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.test.ServerIPDataSave_jsp._jspService(org.apache.jsp.test.ServerIPDataSave_jsp:137)
         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:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1338)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:127)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
         java.lang.ClassLoader.loadClassInternal(Unknown Source)
         java.lang.Class.forName0(Native Method)
         java.lang.Class.forName(Unknown Source)
         org.apache.jsp.test.ServerIPDataSave_jsp._jspService(org.apache.jsp.test.ServerIPDataSave_jsp:71)
         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:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Hope is only the love of life.

    hi,
    FIrst make one thing clear. By classes.jar you mean either classes111.jar or classes12.jar.Right?If not,please check tht.
    Also,u needn't set any classpaths for Tomcat.
    Regards,
    Viswanath.

  • Database Connection problem please help

    Hi,
    I have a servlet that basically connects to the database if the userid and password is correct.
    I have a "login.html" page where the user enters the "userid" and "password".The servlet does the checking and grants access to the user.
    My question is as follows.As soon as I startup tomcat type in the url login.html,then press the submit button,(both the fields are blank) the servlet says "ok" this is this information is present in the database.It should say "not ok".Hope I question is clear.The code for the servlet is given below.
    package package1.structure;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    public class AuthenticateServlet2 extends HttpServlet {
    private String user="";
    private String pass="";
    private String username="";
    private String password="";
    private String message1="";
    public void init() {
    try{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        System.out.println("Driver loaded successfully");
       }//close try
    catch (ClassNotFoundException e) {
    System.out.println(e.toString());
    }//close catch
    }//close init() method
    public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException
    } //close doGet
    public void doPost(HttpServletRequest request,HttpServletResponse response)
    throws ServletException, IOException
      user = request.getParameter("username").trim();
      pass = request.getParameter("password").trim();
      System.out.println("*"+user+"*");
      System.out.println("*"+pass+"*");
      String message = null;
    try{
      Connection con= DriverManager.getConnection("jdbc:odbc:MyDS");
      System.out.println("Successfully connected to database");
      PreparedStatement pstmt;
      pstmt = con.prepareStatement("SELECT username,password FROM users" + " WHERE username ='" + user + "'" +
      " AND password='" + pass + "'");
      ResultSet rs = pstmt.executeQuery();
      if(rs.next())
          username = rs.getString(1);
           password = rs.getString(2);     
    if (username != null && password != null && user.equals(username) && pass.equals(password) ){
        message ="ok";
        PrintWriter out = response.getWriter();
        out.print("<B>" + message + "</B>");
        //response.sendRedirect ("http://localhost:8080/thankyou.html");
    }//closes the if statement
    else {
         message="not ok";
         PrintWriter out = response.getWriter();
         out.print("<B>" + message + "</B>");
        //response.sendRedirect ("http://localhost:8080/sampleapp/login.html");
    }//close else statement
    }//closes 2ndtry
    catch (SQLException e) {
    System.out.println(e.toString());
    }//closes 2ndcatch
    }//close doPost
    }//close classKindly let me know ASAP.
    Regarding the database.The fields in the database are "username" and "password" and it has one tuple
    "xyz" and "xyz"
    Hope that my question is rightly put.
    Thanking you
    AS

    Actually, I think the servlet is doing the right thing
    by printing "ok". A quick glance at your code tells
    me that username and password are both members of your
    servlet class and initialized to "". Neither is null,
    and both are blank.
    If your HTML page sends user and pass as blank
    strings, you'll do a database query for those values.
    If they don't appear in the database, your ResultSet
    will have no rows and the username and password data
    members will not be updated.
    When you get to your if test, neither username nor
    password is null and both are equal to the values
    passed in from the HTML. Hence the "ok".
    If you initialize your username and password members
    to null this might still work.
    Be sure to set them back to null when you finish the
    test.
    If you take all that JDBC code out of the servlet and
    isolate it into its own class, you can test it out by
    feeding it valid and invalid username and password
    combinations. Once you've got that working perfectly,
    you can just have the servlet instantiate your
    database object and call its methods. If you have any
    problems after that point, you know they're due to the
    servlet and not the database interactions.
    Right now the database and servlet are confounded.
    Separate them out and you might make faster progress.
    - MODHello,
    Thanks for the reply.Will consider your points for a proper coding.Will keep posting.
    AS

  • Database connectivity problem..! Help..!

    Hi,
    I have an application running on Windows platform deployed on Weblogic. This application is trying to access a Database which is configured on Redhat Linux 4 -I configure it as a JDBC connection pool in the weblogic, now if i test the connectivity it fails..!! Any suggestions or help?
    Thanks

    can you please ellaborate more on that -how do you do:
    1. Connection pool in DB
    2, Configure the dispatcher paramater.
    I have two connection pool configured in my weblogic pointing to two different DB (One to Windows and the other to Linux)
    Thanks

  • Oracle Database Connectivity Problem.. Please Help

    Hi , i am having a problem in connecting my JSP page to Oracle. I dont know how to work from Scratch like which classes to download for driver and where to put them so that it works for me please also help me in writng connection String. i am writing this code but it generates an error.
    <%
    try
    Connection conn=null; // defining variable
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@serverName:1521:myDatabase", "scott", "tiger");
    Statement st = conn.createStatement();
    String sql = "SELECT * FROM POS";
    ResultSet rs = st.executeQuery(sql);
    String name = rs.getString("DNAME");
    out.println(name);
    catch(Exception e)
    out.println(e);
    %>
    and the Error is
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    I shall be thankful to you for your help.
    Regards,
    Adeel

    Thanks for your reply and sugession. We cannot stop
    using JSP actually. I meant while learning JDBC and attempting to debug it.
    I have been working with ODBC
    drivers and haven't got any problem. Now here you are
    talking about Class.... We haven't download the
    driver yet thats what i was trying to ask that from
    where to dowload those drivers/classes and where to
    put them or how to config them . Your Help is always
    appriciated because it can be really crucial for some
    one else. Any way Thanks again hope to see a reply
    from you.That isn't what your OP suggested. It suggested specifically that you didn't know what a class not found exception meant.
    You can down load the drivers from oracle. Or you can get them from the Oracle client install - just drill down under the install directory.
    As for where you put them, it would be the same place that you put the other drivers that you already have experience with.

  • Help regarding socket and postgresql

    hi, i found this error while im generating a report
    for my system, "Aging of Accounts Receivables"
    hope someone might give me a hint to what should i do.
    here's my StackTrace:
    ***Exception:
    org.postgresql.util.PSQLException: The connection attempt failed because Exception: java.net.BindException: Address already in use: connect
    Stack Trace:
    java.net.BindException: Address already in use: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:179)
    at org.postgresql.core.PGStream.<init>(PGStream.java:47)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:197)
    at org.postgresql.Driver.connect(Driver.java:139)
    org.postgresql.util.PSQLException: The connection attempt failed because Exception: java.net.BindException: Address already in use: connect
    Stack Trace:
    java.net.BindException: Address already in use: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:179)
    at org.postgresql.core.PGStream.<init>(PGStream.java:47)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:197)
    at org.postgresql.Driver.connect(Driver.java:139)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:72)
    at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:55)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:72)
    at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:55)
    at org.postgresql.jdbc3.Jdbc3ConnectionPool.getPooledConnection(Jdbc3ConnectionPool.java:39)
    at org.postgresql.jdbc3.Jdbc3ConnectionPool.getPooledConnection(Jdbc3ConnectionPool.java:39)
    at org.postgresql.jdbc2.optional.PoolingDataSource.getPooledConnection(PoolingDataSource.java:406)
    at org.postgresql.jdbc2.optional.PoolingDataSource.getConnection(PoolingDataSource.java:338)
    at csfwdbillingmodules.dbConnect.<init>(dbConnect.java:73)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.processAccountAR(frmAgingOfAccounts.java:794)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.genDetailedReport(frmAgingOfAccounts.java:1102)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:406)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:400)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:279)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at javax.swing.SwingWorker.run(SwingWorker.java:319)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
    End of Stack Trace
    at org.postgresql.jdbc2.optional.PoolingDataSource.getPooledConnection(PoolingDataSource.java:406)
    at org.postgresql.jdbc2.optional.PoolingDataSource.getConnection(PoolingDataSource.java:338)
    at csfwdbillingmodules.dbConnect.<init>(dbConnect.java:73)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.processAccountAR(frmAgingOfAccounts.java:794)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.genDetailedReport(frmAgingOfAccounts.java:1102)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:406)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:400)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:279)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:208)
    at org.postgresql.Driver.connect(Driver.java:139)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:72)
    at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:55)
    at org.postgresql.jdbc3.Jdbc3ConnectionPool.getPooledConnection(Jdbc3ConnectionPool.java:39)
    at org.postgresql.jdbc2.optional.PoolingDataSource.getPooledConnection(PoolingDataSource.java:406)
    at org.postgresql.jdbc2.optional.PoolingDataSource.getConnection(PoolingDataSource.java:338)
    at csfwdbillingmodules.dbConnect.<init>(dbConnect.java:73)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.processAccountAR(frmAgingOfAccounts.java:794)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.genDetailedReport(frmAgingOfAccounts.java:1102)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:406)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:400)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:279)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at javax.swing.SwingWorker.run(SwingWorker.java:319)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
    java.lang.NullPointerException
    at csfwdbillingmodules.dbConnect.query(dbConnect.java:96)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.processAccountAR(frmAgingOfAccounts.java:798)
    at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.genDetailedReport(frmAgingOfAccounts.java:1102)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at javax.swing.SwingWorker.run(SwingWorker.java:319)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
    End of Stack Trace
    here's my dbConnect.class:
    * dbConnect.java
    * Created on November 14, 2006, 5:06 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    * @author darkoasis
    package csfwdbillingmodules;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.InetAddress;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.net.SocketAddress;
    import java.net.SocketException;
    import java.net.SocketImpl;
    import java.sql.*; // All we need for JDBC
    import javax.naming.NamingException;
    import org.postgresql.jdbc3.Jdbc3PoolingDataSource;
    public class dbConnect
    extends java.lang.Object
    private Socket socket;
    private SocketImpl socketImpl;
    private int refPosition = 0;
    private Jdbc3PoolingDataSource source = new Jdbc3PoolingDataSource();
    private DriverManager drvMgr;
    private Connection db = null; // A connection to the database
    private Statement sql; // Our statement to run queries with
    private ResultSet results; // A result container
    private DatabaseMetaData dbmd; // This is basically info the driver delivers
    // about the DB it just connected to. I use
    // it to get the DB version to confirm the
    // connection in this example.
    /** Creates a new instance of dbConnect */
    public dbConnect()
    try
    this.source.setServerName("10.10.10.10");
    this.source.setDatabaseName("myDB");
    this.source.setUser("xxxx");
    this.source.setPassword("xxxx");
    this.db = this.source.getConnection();
    this.socket = new Socket();
    dbmd = this.db.getMetaData(); //get MetaData to confirm connection
    sql = this.db.createStatement(); //create a statement that we can use later
    catch (Exception ex)
    System.out.println("***Exception:\n"+ex);
    ex.printStackTrace();
    public ResultSet query(String strSQL)
    throws SQLException
    this.results = this.sql.executeQuery(strSQL);
    return this.results;
    public void update(String strSQL)
    throws SQLException
    this.sql.executeUpdate(strSQL);
    public void close()
    throws Exception
    this.db.close();
    this.socket.close();
    this.source.close();
    public boolean isClosed()
    throws SQLException
    return this.db.isClosed();
    i ran into some forums and found this:
    Hi Graham
    I'm making a bit of progress. I found a website that suggested the following
    This is a problem of the used sockets with Windows NT. You can request the active sockets with the command netstat. The problem is a function of:
    MaxUserPort (default 5000)
    KeepAliveTime (default 120)
    it suggested the workaround was connection pooling
    I have run netstat to look at the number of connections when the problem occurs and waited for the timeout to reset the os back to the minimum and on each occasion my report has run
    Does this sound logical?
    If so
    do you have any examples on connection pooling
    it seems that even if i have closed my database connection it still doesn't free my port that was used, that's why i get this error
    i am looking for a way to close my db connection and free its socket or port used at the same time, hope you can help,
    thanks in advance

    Duplicate of this thread, reply there:
    http://forum.java.sun.com/thread.jspa?threadID=5121873&messageID=9426716#9426716

  • Wsdl trouble - WILL PAY FOR IMMEDIATE HELP

    I'm having trouble consuming a webservice - code works in PHP
    but coldfusion keeps getting back a null value. The function only
    takes 1 parameter, of which I'm sending. I'll paypal you money for
    your help - PM me for details

    > WILL PAY FOR IMMEDIATE HELP
    I do not believe that that is in the spirit of this forum. If
    you post your code here, you will most likely get a quick answer to
    the question anyway.

  • Need Immediate help...importing issue

         I work for a video editing company and today out of the blue, Premiere Pro started to act funny, its auto cropping clips that I am importing. It used to import these files fine and now its cutting them in half, I have tried all the basic stuff...I sort of also work IT here so the (re-install, reboot, try different settings) have all been done. The fact is it was doing it fine the other day and now it is making my workflow for the day grind to a halt until I figure this out.
    Immediate help/suggestions would be greatly appreciated.
                                                This is how its importing                                                                                 This his how it plays in a media player
    -Chris

    Im using Adobe Premiere CS5.5
    I have all updates
    Using windows 7 Pro
    Intel Core i7 2600K CPU @ 3.4Ghz
    16GB of ram
    64 bit OS
    source footage is:
    WMV File
    640x480
    2000kbps data rate
    29 fps
    I get no error codes
    this occurs immediatley when I drop it into premiere, and in the timeline and when I export.
    Thank you

  • Scrambled QT video on my PC... immediate help requested....

    Ive never had a problem with QT movies on my PC before, but for some reason every single .mov file I open is now scrambled or encoded and all I get is square chunks... with good audio. BUT... when I transfer them to my Mac G5, they play back just fine... and that is with the standard Quicktime version.
    I have Windows XP and I've had Quicktime Pro for a few years now with no difficulties... I have old and new .mov files on my hard drive that I have been playing on my PC with absolutely no problems, but all of a sudden... SCRAMBLE CITY BABY! Ive gone through some troubleshooting basics... like updating QT and directx...but to no avail.
    I consider myself somewhat technically savvy, as I am a graphics and program editor on both Macs and PCs. But this problem has got me scratching my head... I can usually solve these issues through these forums, but I cant seem to find the answer for my particular problem.
    Any immediate help would be very much appreciated... thanks!!

    Sounds like a graphics card driver or similar issues.
    Try this:
    Open the QuickTime Control Panel and click the advanced tab. Place a check mark (under the Video settings) for "Safe Mode" and try the file again. A quit and restart of QuickTime Player may be required.
    If "safe mode" works you may need to update your "driver" software before trying the "DirectX" features.

  • Query- Personnel Cost Planning-Immediate Help required

    Hi,
    I have a query.
    I am trying to Assign Percentage to Cost Item ( Personnel cost Planning)- Bonus which is a dependent cost item to Direct Cost Item-Base Salary but when I run the
    T. Code:- PHCPADMN the Bonus Percentage is not getting reflected and if I run the report-Plan data it is not showing any calculation of percentage.
    Kindly any immediate help is highly appreciable as I need to resolve it ASAP.
    Regards,
    Happy

    Hi Soniya
    I think you should look into following links:
    help.sap.com/printdocu/core/Print46c/en/data/pdf/PACMCP/PACMCP.pdf
    help.sap.com/saphelp_46c/helpdata/en/fd/45a4f79d6411d189b60000e829fbbd/content.htm
    Thanks
    Yash

  • ANOTHER SCAMMER ASKING FOR INFO screen name "Get Immediate Help"

    Scammer contacted me after posting for help with my adobe product.
    Screen name "Get Immediate Help"
    Asked to talked to me via skype and then asked for Adobe ID and password

    Looks like he was deactivated.

  • Tomcat and Postgres TCP/IP Connection Problem

    Hello,
    i have a linux server with tomcat 5.0.25 and another linux server with postgres, i have a webapp that uses Connection Pooling for the database connection, when im going to open the connection i get this error:
    org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP
    But when i try this from mi windows pc the connection is succesful and i have the same tomcat version.
    Can somebody help me?
    Thanks in Advance
    Escobar5

    Postgres has a pg_hba.conf file that configures access to the database. Access is configured on an IP address basis. Probably your PC has an IP address that is configured in the file to allow access and the Linux server doesn't. Check the Postgres documentation on how to change this file to allow access form teh linux server

  • Tomcat JDBC Realm Database Connection Error

    Hello all,
    I am trying to edit the server.xml file on Tomcat so I can use the JDBC Realm instead of the MemoryRealm. Hence, I will be able to read users, passwords and roles from a relational database instead of from the tomcat-users.xml.
    I have tried following all the guides on the net I can find, my server.xml looks as follows (after making changes to allow it to use JDBC realm). The only problem is, when I try to run the application the server outputs the following: (after all of these errors have been kicked up a pop-up box then appears titled "Tomcat Manager Application", it asks for a User Name and Password. I have tried the standard user name of "ide" and the password next to it in tomcat-users.xml but it won't accept it. (I am using the netbeans IDE)).
    Please could someone suggest any ideas of how I can get the server.xml to work with JDBC realm?
    Using CATALINA_BASE:   C:\Documents and Settings\Administrator\.netbeans\5.0beta\jakarta-tomcat-5.5.7_base
    Using CATALINA_HOME:   C:\Program Files\netbeans-5.0beta\enterprise2\jakarta-tomcat-5.5.7
    Using CATALINA_TMPDIR: C:\Documents and Settings\Administrator\.netbeans\5.0beta\jakarta-tomcat-5.5.7_base\temp
    Using JAVA_HOME:       C:\j2sdk1.4.2_08
    Created MBeanServer with ID: 1f934ad:107444b1d2b:-8000:ravinder-rdnzoa:1
    31-Oct-2005 01:29:33 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8084
    31-Oct-2005 01:29:34 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8443
    31-Oct-2005 01:29:34 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2174 ms
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
    31-Oct-2005 01:29:34 org.apache.catalina.realm.JDBCRealm start
    SEVERE: Exception opening database connection
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:720)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
            at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
            at org.apache.catalina.core.StandardService.start(StandardService.java:450)
            at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
            at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    31-Oct-2005 01:29:36 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name IBM used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:36 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name Auditor used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:37 org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    31-Oct-2005 01:29:37 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    31-Oct-2005 01:29:37 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    31-Oct-2005 01:29:38 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name IBM used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:38 org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    31-Oct-2005 01:29:38 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    31-Oct-2005 01:29:38 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    31-Oct-2005 01:29:39 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8084
    31-Oct-2005 01:29:39 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8443
    31-Oct-2005 01:29:40 org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    31-Oct-2005 01:29:40 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/60  config=null
    31-Oct-2005 01:29:40 org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    31-Oct-2005 01:29:40 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 5738 ms
    31-Oct-2005 01:29:40 org.apache.catalina.realm.JDBCRealm authenticate
    SEVERE: Exception performing authentication
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:344)
            at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:534)
    31-Oct-2005 01:29:40 org.apache.catalina.realm.JDBCRealm authenticate
    SEVERE: Exception performing authentication
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:344)
            at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:534)The server.xml looks as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
         parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
         which may contain one or more "Service" instances.  The Server
         listens for a shutdown command on the indicated port.
         Note:  A "Server" is not itself a "Container", so you may not
         define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8025" shutdown="SHUTDOWN">
        <!-- Comment these entries out to disable JMX MBeans support used for the
        administration web application -->
        <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
        <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
        <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
        <!-- Global JNDI resources -->
        <GlobalNamingResources>
            <!-- Test entry for demonstration purposes -->
            <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
            <!-- Editable user database that can also be used by
            UserDatabaseRealm to authenticate users -->
       <!-- RAV
            <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml"/>
          -->
        </GlobalNamingResources>
        <!-- A "Service" is a collection of one or more "Connectors" that share
        a single "Container" (and therefore the web applications visible
        within that Container).  Normally, that Container is an "Engine",
        but this is not required.
        Note:  A "Service" is not itself a "Container", so you may not
        define subcomponents such as "Valves" or "Loggers" at this level.
        -->
        <!-- Define the Tomcat Stand-Alone Service -->
        <Service name="Catalina">
            <!-- A "Connector" represents an endpoint by which requests are received
            and responses are returned.  Each Connector passes requests on to the
            associated "Container" (normally an Engine) for processing.
            By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
            You can also enable an SSL HTTP/1.1 Connector on port 8443 by
            following the instructions below and uncommenting the second Connector
            entry.  SSL support requires the following steps (see the SSL Config
            HOWTO in the Tomcat 5 documentation bundle for more detailed
            instructions):
            * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
            later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
            * Execute:
            %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
            $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
            with a password value of "changeit" for both the certificate and
            the keystore itself.
            By default, DNS lookups are enabled when a web application calls
            request.getRemoteHost().  This can have an adverse impact on
            performance, so you can disable it by setting the
            "enableLookups" attribute to "false".  When DNS lookups are disabled,
            request.getRemoteHost() will return the String version of the
            IP address of the remote client.
            -->
            <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
            <Connector port="8084" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"/>
            <!-- Note : To disable connection timeouts, set connectionTimeout value
            to 0 -->
            <!-- Note : To use gzip compression you could set the following properties :
            compression="on"
            compressionMinSize="2048"
            noCompressionUserAgents="gozilla, traviata"
            compressableMimeType="text/html,text/xml"
            -->
            <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
            <Connector port="8443"
            maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
            enableLookups="false" disableUploadTimeout="true"
            acceptCount="100" scheme="https" secure="true"
            clientAuth="false" sslProtocol="TLS" />
            <!-- Define an AJP 1.3 Connector on port 8009 -->
            <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3"/>
            <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
            <!-- See proxy documentation for more information about using this. -->
            <!--
            <Connector port="8082"
            maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
            enableLookups="false" acceptCount="100" connectionTimeout="20000"
            proxyPort="80" disableUploadTimeout="true" />
            -->
            <!-- An Engine represents the entry point (within Catalina) that processes
            every request.  The Engine implementation for Tomcat stand alone
            analyzes the HTTP headers included with the request, and passes them
            on to the appropriate Host (virtual host). -->
            <!-- You should set jvmRoute to support load-balancing via AJP ie :
            <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">        
            -->
            <!-- Define the top level container in our container hierarchy -->
            <Engine name="Catalina" defaultHost="localhost">
                <!-- The request dumper valve dumps useful debugging information about
                the request headers and cookies that were received, and the response
                headers and cookies that were sent, for all requests received by
                this instance of Tomcat.  If you care only about requests to a
                particular virtual host, or a particular application, nest this
                element inside the corresponding <Host> or <Context> entry instead.
                For a similar mechanism that is portable to all Servlet 2.4
                containers, check out the "RequestDumperFilter" Filter in the
                example application (the source for this filter may be found in
                "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
                Request dumping is disabled by default.  Uncomment the following
                element to enable it. -->
                <!--
                <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
                -->
                <!-- Because this Realm is here, an instance will be shared globally -->
                <!-- This Realm uses the UserDatabase configured in the global JNDI
                resources under the key "UserDatabase".  Any edits
                that are performed against this UserDatabase are immediately
                available for use by the Realm.  -->
                <!-- RAV
               <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
               -->
                <!-- Comment out the old realm but leave here for now in case we
                need to go back quickly -->
                <!--
                <Realm className="org.apache.catalina.realm.MemoryRealm" />
                -->
                <!-- Replace the above Realm with one of the following to get a Realm
                stored in a database and accessed via JDBC -->
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="org.gjt.mm.mysql.Driver"
                connectionURL="jdbc:mysql://localhost:3306/tomcatusers"
                connectionName="root" connectionPassword="sikhism1"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                <!--
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="oracle.jdbc.driver.OracleDriver"
                connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
                connectionName="scott" connectionPassword="tiger"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                -->
                <!--
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="sun.jdbc.odbc.JdbcOdbcDriver"
                connectionURL="jdbc:odbc:CATALINA"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                -->
                <!-- Define the default virtual host
                Note: XML Schema validation will not work with Xerces 2.2.
                -->
                <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
                    <!-- Defines a cluster for this node,
                    By defining this element, means that every manager will be changed.
                    So when running a cluster, only make sure that you have webapps in there
                    that need to be clustered and remove the other ones.
                    A cluster has the following parameters:
                    className = the fully qualified name of the cluster class
                    name = a descriptive name for your cluster, can be anything
                    mcastAddr = the multicast address, has to be the same for all the nodes
                    mcastPort = the multicast port, has to be the same for all the nodes
                    mcastBindAddr = bind the multicast socket to a specific address
                    mcastTTL = the multicast TTL if you want to limit your broadcast
                    mcastSoTimeout = the multicast readtimeout
                    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
                    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
                    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
                    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
                    in case of multiple ethernet cards.
                    auto means that address becomes
                    InetAddress.getLocalHost().getHostAddress()
                    tcpListenPort = the tcp listen port
                    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
                    has a wakup bug in java.nio. Set to 0 for no timeout
                    printToScreen = true means that managers will also print to std.out
                    expireSessionsOnShutdown = true means that
                    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
                    false means to replicate the session after each request.
                    false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
                    <%
                    HashMap map = (HashMap)session.getAttribute("map");
                    map.put("key","value");
                    %>
                    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
                    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
                    * Synchronous means that the thread that executes the request, is also the
                    thread the replicates the data to the other nodes, and will not return until all
                    nodes have received the information.
                    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
                    so the request thread will queue the replication request into a "smart" queue,
                    and then return to the client.
                    The "smart" queue is a queue where when a session is added to the queue, and the same session
                    already exists in the queue from a previous request, that session will be replaced
                    in the queue instead of replicating two requests. This almost never happens, unless there is a
                    large network delay.
                    -->
                    <!--
                    When configuring for clustering, you also add in a valve to catch all the requests
                    coming in, at the end of the request, the session may or may not be replicated.
                    A session is replicated if and only if all the conditions are met:
                    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
                    2. a session exists (has been created)
                    3. the request is not trapped by the "filter" attribute
                    The filter attribute is to filter out requests that could not modify the session,
                    hence we don't replicate the session after the end of this request.
                    The filter is negative, ie, anything you put in the filter, you mean to filter out,
                    ie, no replication will be done on requests that match one of the filters.
                    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
                    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
                    ending with .gif and .js are intercepted.
                    The deployer element can be used to deploy apps cluster wide.
                    Currently the deployment only deploys/undeploys to working members in the cluster
                    so no WARs are copied upons startup of a broken node.
                    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
                    When a new war file is added the war gets deployed to the local instance,
                    and then deployed to the other instances in the cluster.
                    When a war file is deleted from the watchDir the war is undeployed locally
                    and cluster wide
                    -->
                    <!--
                    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                    expireSessionsOnShutdown="false"
                    useDirtyFlag="true"
                    notifyListenersOnReplication="true">
                    <Membership
                    className="org.apache.catalina.cluster.mcast.McastService"
                    mcastAddr="228.0.0.4"
                    mcastPort="45564"
                    mcastFrequency="500"
                    mcastDropTime="3000"/>
                    <Receiver
                    className="org.apache.catalina.cluster.tcp.ReplicationListener"
                    tcpListenAddress="auto"
                    tcpListenPort="4001"
                    tcpSelectorTimeout="100"
                    tcpThreadCount="6"/>
                    <Sender
                    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                    replicationMode="pooled"
                    ackTimeout="15000"/>
                    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
                    filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
                    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>
                    </Cluster>
                    -->
                    <!-- Normally, users must authenticate themselves to each web app
                    individually.  Uncomment the following entry if you would like
                    a user to be authenticated the first time they encounter a
                    resource protected by a security constraint, and then have that
                    user identity maintained across *all* web applications contained
                    in this virtual host. -->
                    <!--
                    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.AccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    This access log implementation is optimized for maximum performance,
                    but is hardcoded to support only the "common" and "combined" patterns.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    This access log implementation is optimized for maximum performance,
                    but is hardcoded to support only the "common" and "combined" patterns.
                    This valve use NIO direct Byte Buffer to asynchornously store the
                    log.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.ByteBufferAccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                </Host>
            </Engine>
        </Service>
    </Server>Many thanks, and apologies for "dumping" all of the code here.

    So looking through the java api docs, I found that the tcUtilJDBCOperations has a connect string for the database. Below is the info it outlines. The questions I have it this. How do you specify the psdriver and URL along with do I need to do this as a persistent instance then add my selectstatement as a part of this or can I just specify this and the select statement will use this connection? Any help you can give would be appreciated.
    tcUtilJDBCOperations
    public tcUtilJDBCOperations(java.lang.String psDriver,
    java.lang.String psUrl,
    java.lang.String psUsername,
    java.lang.String psPassword)Contructor that sets the parameters for connecting to a database
    Parameters:
    psDriver - The class name of the jdbc driver
    psUrl - The URL of the database
    psUsername - The username required to access the database
    psPassword - The password for the above username
    Nick

  • Oracle Tomcat Connection Problem

    Dear all,
    We have Oracle as the back end and Java-Jsp-Struts as the front end for our project.For the last few days we are facing a strange problem and although we tried a lot we were not able to find even the cause of the problem
    We have Oracle server and Webserver running on seperate machine. As this is a webbased solution , clients can take the pages by putting the URL in the browser. The problem is that the connection to the database is lost sometimes and we need to restart our apache tomcat service to get the connection again. Once it is restarted the pages work fine for sometime and after sometime the problem comes again. Sometimes the problem occures frequently and sometimes rarely.
    Please help us as we tried a lot to troubleshoot but failed.
    Whenever we are loosing connection, the database or listener seem to have no problem as they are running perfectly fine. Is there something that should be done in Tomcat for oracle connections? Or if multiple users are accessing the database at the same time is there something to do sothat the webserver is able to handle these multiple connections and update operations?
    The error messages that we get are:
    The network adapter could not establish the connection
    or The TNS Listener could not resolve the SID given in the connection descriptor
    If the error is the second one then sometimes it will vanish after sometime even without restarting thr tomcat service . But for the first one we must restart the service
    All suggessions are welcome.
    Regards,
    Cochu.

    Hi,
    Thanks for your valuable suggession, but when I
    tried to ping from webserver to db server, it was
    pinging all the time and I am sure that the LAN
    Connection is alright.
    Regards,
    Cochu.No, the fact that Oracle works at all says that your network connection between servers is not the problem.
    When you say "connection to Oracle", it sounds like you literally mean a single connection to Oracle. You open the connection on startup, so if it's stale or lost or dropped you have to restart the web app. Is this true?
    If it is, your solution is to use a database connection pool and rewrite the database code in such a way that you get a fresh connection out of the pool when request comes in, use it, and immediately close it in the same scope, returning it to the pool. Scope should be within a single transaction in a single method. You should keep a connection open only for as long as you need it for a request.
    %

Maybe you are looking for

  • Create A/R credit memo based on paid (closed) A/R invoice.

    Hello All, Many customers need a possibility to create credit memo based on paid invoice to make control on sales quantities, sales price with any discount and cost of good sold. Is there a way to create A/R credit memo based on closed A/R invoice (P

  • Drop down by Index label

    Hi all, I have a "drop down by index" UI element in my webdynpro which is bound to a value node which intern gets values from a model node. Values are visible in the drop down and also are going to the BAPI proprely. But, I want to show an entry simi

  • DLT writes perfect, but won`t read!

    Hi, because of one stupid replicator, who as a problem to take a burned DVD-9 master, we had to pack out our old DLT-Tape (which was dead), bought a new one, which writes faster than anything else which I have previously seen (Quantum DLT V 4) - but

  • I Haw Problems With Congfirming my Credit Card! HELP

    Hello... I Haw Some Problem To Verify/Confirm My Credit Card.I Haw 4 Digits Code from my bank. This is The Reasion when i click Continue! What to do The Credit Card Verification System used by PayPal is currently unavailable. Please try to add your c

  • Iphone 5s hangs up when talking.  Verizon rep said it needed to be calibrated or sensor adjusted, how do you do that?

    Every time I talk on my iPhone 5s, my cheek hits the face time button or just ends the call.  I was in a Verizon store and they told me the sensor needs adjusting or it needs to be calibrated but I didn't have my phone with me at the time.  I can't f