GenericDataSource and Postgresql

I'm having a problem with compiling a connection pool class which I'm using from the Wrox book, "Beginning JSP Web Development". What should I do to subtitute with this class or how do I work around these errors. I'm guessing that I may be working with an obsolete api. It's been digging into me for a few hours, if not days.
Here are the details:
The DBInitServlet.java looks like this:
package scenario.db.util;
import javax.servlet.http.HttpServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.DriverManager;
import org.apache.struts.util.GenericDataSource;
public class DBInitServlet extends HttpServlet {
     public void init(ServletConfig config) throws ServletException {
          super.init(config);
          try {
               GenericDataSource ds = new GenericDataSource();
               ds.setDriverClass(getInitParameter("driverClass"));
               ds.setUrl(getInitParameter("jdbcURL"));
               ds.setMinCount(Integer.parseInt(getInitParameter("minCount")));
               ds.setMaxCount(Integer.parseInt(getInitParameter("maxCount")));
               ds.setAutoCommit(false);
               ds.open();
               ConnectionPool.init(ds);
          } catch (SQLException e) {
            e.printStackTrace();
            throw new ServletException("Unable to Open datasource.");
}Here are the errors:
scenario\db\util\DBInitServlet.java:12 cannot resolve symbol
symbol   : class GenericDataSource
location : package util
import org.apache.struts.util.GenericDataSource;
                              ^
scenario\db\util\DBInitServlet.java:22 cannot resolve symbol
symbol   : class GenericDataSource
location : class scenario.db.util.DBInitServlet
                         GenericDataSource ds = new GenericDataSource();
                         ^
scenario\db\util\DBInitServlet.java:22 cannot resolve symbol
symbol   : class GenericDataSource
location : class scenario.db.util.DBInitServlet
                         GenericDataSource ds = new GenericDataSource();
                                                    ^3 errors
My web.xml has the following:
  <servlet>
       <servlet-name>dbinit/servlet-name>
       <servlet-class>scenario.db.util.DBInitServlet</servlet-class>
       <init-param>
          <param-name>driverClass</param-name>
          <param-value>org.postgresql.driver</param-value>
       </init-param>
       <init-param>
          <param-name>jdbcURL</param-name>
          <param-value>jdbc:postgresql://localhost:5432/rtm</param-value>
       </init-param>
       <init-param>
          <param-name>minCount</param-name>
          <param-value>1</param-value>
       </init-param>
       <init-param>
          <param-name>maxCount</param-name>
          <param-value>10</param-value>
       </init-param>
       <load-on-startup>3</load-on-startup>
  </servlet>What kind of adjustments should I make?
Thank you,
Warren

This problem is fixed with HS and DBLink.

Similar Messages

  • REPLICATION BETWEEN ORACLE 10g and postgresql/MySQL/MSSQL SERVER??

    Hi Friends.
    I want to know if there are a manner of replication between ORACLE and (postgresql or mysql or mssqlserver).
    Please, my email is [email protected]
    Thanks
    Manuel

    Sure.
    Are you talking about replicating data in one direction? If so, in which direction (Oracle to non-Oracle or non-Oracle to Oracle)? Or are you talking about bidirectional replication?
    Which database do you want to be the "master" (i.e. initiate the push or pull of data)?
    What sort of lag is acceptable? Minutes? Hours? Days?
    Justin

  • Comparison of Oracle, MySQL and PostgreSQL DBMS

    Hi,
    Wanted to share this article:
    http://www-css.fnal.gov/dsg/external/freeware/mysql-vs-pgsql.html
    Regards,
    Priyanka

    thanks for the link. i wonder how they determined
    the % of installations though.
    anyone know?Very approximately it would seem. They quote market share as of July 1 2004 showing MySQL at 33%, the same numbers are on the MySQL site.
    SQL Server with 78%, Oracle - 55%, MySQL - 33% and PostgreSQL - 8%.
    While this story from June 4 2004 quoting IDC research has the Market shares for 2003 at
    http://www.internetnews.com/stats/article.php/3363801
    Oracle garnered 39.8 percent of the market for software that helps users retrieve and store information, with IBM nabbing 31.3 percent and Microsoft grabbing 12.1, ... open source database leader MySQL's market share is a negligible one-tenth of 1 percent now
    And I'm sure a bit more googling could throw up even more wildly different numbers.
    Like this more recent Gartner survey for 2005
    http://www.forbes.com/markets/2006/05/25/oracle-0525markets13.html
    According to the Gartner study, Oracle (nasdaq: ORCL - news - people ) enjoys about 50% of the total RDBMS market
    This would be nice if Oracle ever implemented it,
    Oracle: Yes. ON DELETE CASCADE supported
    PostgreSQL: Yes. ON DELETE CASCADE and ON UPDATE CASCADE supported. Message was edited by:
    3360
    I never noticed that the quoted numbers don't even add up to 100% percent so it is not really market share.

  • HS and PostgreSQL

    I need help to establish a connection (dblink) to a PostgreSQL database from an Oracle 10g database. Both are on different node.
    Node a : Windows 2003 Server Std - Oracle 10g
    Node b : Red Hat Linux (7.3 I think) and PostgreSQL 7.2.1
    I am not shure of what need to be done were, especialy when it comes to the odbc driver. Should I install and configure the PostgreSQL ODBC Driver on the Oracle box or on the PostgreSQL box.
    Also, I found that listener.ora, tnsnames.ora needs some special entry to make it word and that some files needs to be edited under ORACLE_HOME\hs
    Anyone could help me to put some order in it ?

    You have to use GENERIC CONNECTIVITY also called HSODBC.
    It requires an ODBC driver installed on the Oracle machine (Windows in your case) which then connects to your foreign database.
    A generic set up is available in Metalink Note Note.109730.1 Ext/Pub How to setup generic connectivity (HSODBC) for Windows NT
    - configure the listener
    - configure tensnames
    - make sure you have a PostgreSQL ODBC installed on the Windows machine and you created a system DSN
    - configure init<hsodbc> pointing to the SYSTEm DSN

  • DPS and PostgreSQL - problem with add/modify

    Hi All,
    Did anyone try to combine DPS and PostgreSQL database? I am trying to do this and everything works OK except add and modify operations from LDAP client.
    E.g. When I try to modify entry I got following error:
    [29/Jun/2009:15:27:20 +0200] - PROFILE - INFO - conn=19 assigned to connection handler cn=anonymous, cn=connection handlers, cn=config
    [29/Jun/2009:15:27:20 +0200] - SERVER_OP - INFO - conn=19 op=0 MODIFY dn="uid=6886,dc=example,dc=com" jdbcServer=test-jsource sqlStatement="UPDATE persons SET persons.name='Yoko1' WHERE persons.id = 6886"
    [29/Jun/2009:15:27:20 +0200] - SERVER_OP - INFO - conn=19 op=0 MODIFY RESPONSE err=1 msg="java.lang.Exception: org.postgresql.util.PSQLException: ERROR: column "persons" of relation "persons" does not exist" jdbcServer=test-jsource
    [29/Jun/2009:15:27:20 +0200] - OPERATION - INFO - conn=19 op=0 MODIFY RESPONSE err=1 msg="java.lang.Exception: org.postgresql.util.PSQLException: ERROR: column "persons" of relation "persons" does not exist" etime=0
    The exception comes from Postgresql database, because it doesn't accept including table's name in the specification of a target column. For example (from Postgresql documentation): UPDATE tab SET tab.col = 1 is invalid, should be UPDATE tab set col =1.
    Is there a way to workaround this somehow?
    I use DPS 6.3 and Postgres DB 8.3.7.
    Thanks,
    Greg

    FYI, the list of RDBMS tested with DPS is available at [http://docs.sun.com/app/docs/doc/820-2759/additional-software?l=en&a=view&q=mySQL|http://docs.sun.com/app/docs/doc/820-2759/additional-software?l=en&a=view&q=mySQL]

  • Connection Between JSP and PostgreSQL

    Hello all,
    Pls provide me some code about database connection between JSP and PostgreSQL.
    i need reference of PostgreSQL and JSP also.
    Thanking u,
    Ripon

    go to PostgreSQL website and download the JDBC or other connection and use it.
    Setup the connection from your controlpanel > ODBC data source if its win98 OS.

  • JDeveloper 10.1.2 with MySQL and PostgreSQL

    I'm testing JDeveloper 10.1.2 business components with mysql or postgresql because my company needs to connect also to these non-oracle DBs. ADF suits our developement needs, in speed and functionalities; anyway to make it our main developement system we need it to be compatible.
    I made three tests and they were all disappointing.
    At first, I installed MySQL 4.0 on my windows machine. I used the stable Connector/J 3.1
    and then MySQL Connector/J 3.0, but in both cases JDeveloper had a strange behaviour: I can make the connection, I can navigate correctly through all tables in the connection-navigator, I see all the column names etc... Anyway, as I try to build a "new Entity Object" from a table, there are no available table properties, like if the table had no columns.
    In this forum I only found documentation about rowid problems with mysql, but nothing about Entity Object wizard issues.
    Then I switched to PostgreSQL. I installed it locally, so I had to choose the 8.01 since I'm on a windows machine. JDBC driver: postgresql-8.0-310 jdbc3
    The developement test phase went ok, it is possible to use this DB just as if it was a Oracle, all the business components wizards works perfectly.
    The problem is at runtime, unfortunately. I built a simple datapage on the struts-config diagram and I dragged on it a "read-only table" from the data control palette.
    As I run the application, the embedded OC4J immediately returns this error:
    oracle.jbo.JboException: JBO-29000: JBO-29000: JBO-29000: JBO-26061: Errore durante lapertura della connessione JDBC.
    at oracle.jbo.JboException.<init>(JboException.java:343)
    (in english: Error during JDBC connection)
    There are no other available JDBC drivers for JVM 1.4x so I see no solution...
    I also tried to connect to an older PostgresSQL with its (older) JDBC but I get same the result.
    Anyone can help? Is it a JDev 10.1.2 issue?

    Hi Paolo.
    I'm also doing such tests.
    I did not ran into these problems because I created the busisness componentes using an Oracle connection first.
    After that, I switched the datatype of the table columns in the entity object to meet the SQL92 criteria ( like changing NUMBER(n) to INTEGER ).
    And then, I switched the connection to the postgreSQL or MySQL. This worked fine for me.
    But, the other big problem you will face is related to updating records using postgreSQL connection.
    Please see my post "Problem updating records using BC4J with foreign data sources" Problem updating records using BC4J with foreign data sources
    It would by fine if we help each other to solve this problems.
    Thanks
    Denis

  • SAP BI 4.0 SP2 on Linux and Postgresql Datasource via JDBC drivers

    Hi,
    I installed SAP BI Platform 4.0 SP2 on Redhat 5.2 and i try to access as a universe datasource a postgresql database (v8.4). But i don't know how to configure the postgresql JDBC driver on linux server.
    does anyone have a step by step procedure to configure this JDBC postgresql driver on linux ?
    I download this driver : http://jdbc.postgresql.org/download/postgresql-8.4-703.jdbc3.jar
    I read the SAP Data Access document for SAP BI 4.0 SP2 about JDBC connexions, they talk about a SBO file located in $ROOT_DIR/sap_bobj/enterprise_xi40/dataAccess/connectionServer/jdbc , but there isn't any SBO file for postgresql database ?
    Thanks in advance
    JP
    Edited by: Jean-Philippe ARNALOT on Oct 6, 2011 6:58 PM

    Hi
    I found a solution alone, this note 1347514 helps me :
    My conf : Redhat 5.2 + SAP BI 4.0 SP2 + postgresql 8.4 datasource + jdbc drivers
    My solution :
    1) Download JDBC drivers on client side (http://jdbc.postgresql.org/download/postgresql-8.4-703.jdbc3.jar)
    2) Create and export a JDBC connexion for postgresql8
    3) Create and export a universe using this connexion (test a query in universe design tool tools/Querybuilder)
    4) install JDBC drivers on server side, i copied the jar file in this location : $ROOT_DIR/sap_bobj/enterprise_xi40/dataAccess/connectionServer/drivers/java/postgresql-8.4-703.jdbc3.jar
    5) Set your classpath in your .profile : CLASSPATH=$CLASSPATH:/export/logiciels/tes-boxi/sap_bobj/enterprise_xi40/dataAccess/connectionServer/drivers/java/postgresql-8.4-703.jdbc3.jar; export CLASSPATH
    6) Source your .profile
    7) Restart servers (i think restarting only webi server would be ok)
    8) Open BI LaunchPad, start Webi and execute a query on postgresql universe
    It Works with my configuration
    Thanks for your help 
    JP

  • J2EE with JDeveloper and postgresql

    Hi folks,
    I'm creating a j2ee app (struts) with jdev with oracle9i
    and this work fine...
    but I have try connect with another database
    (postgresql 7.4) to recovery some data
    and the local container of jdev is not recognizing
    the postgresql driver...
    where I do to make the internal container
    work with jdbc postgre driver ?

    To configure the the PostgreSQL JDBC driver:
    1. Select Tools>Preferences in JDeveloper.
    2. In the Preferences frame, select the Database Connections node. Select Library New button.
    3. Select the Registered JDBC Drivers field New button.
    4. In the Driver Class field specify org.postgresql.Driver
    5. Select Library field New button.
    6. In the Create Library frame specify a Library Name, and add the PostgreSQL JDBC jar file pg74.215.jdbc2.jar to the Class Path field.
    The PostgreSQL JDBC driver library gets added to the Preferences frame.

  • 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

  • PHP and Postgresql nightmare

    Hello all.. I have read numerous articles and how-to's on compiling PHP that includes the PostgreSQL extensions and have followed all their recommendations. Yet, my apache insists on reading the PHP directive from /usr/libexec/apache2 and my installation of PHP apparently doesn't create a new libphp5.so file.
    I've compiled and installed apache 2.2.9, verified by running httpd -v, so I know my installation went off smoothly, yet the httpd.conf file is the same as before. One of the suggestions (which I followed) was to configure the new installation using Darwin as the layout. Has anyone else encountered this? How are you able to make a new PHP installation be recognized by an updated Apache server?
    I'm completely lost!
    Pedro Maldonado

    This may sound silly, but how can I find out where the build is placed? I figured since I used the Darwin layout for Apache, the server file/folder structure would remain the same as it comes from Apple (Leopard). When I check "httpd -v" I do get the correct version I built (v 2.2.9).
    I wonder if by using the Darwin layout, Apache doesn't build where php expects it to be? The idea for building Apache with that layout came from the PHP.net site, from one of the comments on the compiling and installation sections.
    P

  • Pgbouncer and postgresql dependency

    Hi,
    Since pgbouncer is just a connection pooler and is not linked to postgresql library, why does postgresql have to be a dependency? It's very possible that the postgresql server is located in another server.
    /etc/pacman.d # pacman -Si pgbouncer
    Repository : extra
    Name : pgbouncer
    Version : 1.5.4-6
    Description : A lightweight connection pooler for PostgreSQL
    Architecture : x86_64
    URL : http://pgfoundry.org/projects/pgbouncer
    Licenses : BSD
    Groups : None
    Provides : None
    Depends On : libevent>=2.0 postgresql
    /etc/pacman.d # ldd /usr/bin/pgbouncer
    linux-vdso.so.1 (0x00007fffc2bfe000)
    libevent-2.0.so.5 => /usr/lib/libevent-2.0.so.5 (0x00007fc559fc1000)
    libcrypt.so.1 => /usr/lib/libcrypt.so.1 (0x00007fc559d89000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007fc5599db000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fc5597bd000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fc55a209000)
    Last edited by char101 (2014-07-01 05:15:59)

    If you think it's a problem file a feaure request via the Bug Tracker to have it amended.  Or just use ABS to try to build it without.

  • I am having trouble with php and postgresql on OS X 10.7.5

    I have php, postgresql 5.3.23, and apache installed.  However, when I go to my web browser and open the pages things don't work when I try to enter info in the search boxes.  I get this error immediately upon typing something in the search box.
    Fatal error: Call to undefined function pg_pconnect() in /www/Includes/file.php on line 12
    I have installed and configured the php.ini file to reflect extension=pcntl.so and extension=pgsql.so, restarted apache, and still no luck.  I have to be just missing some minor thing that is major in terms of workability.  Can anyone help?

    I have noticed that this error is being recorded in the Apache logs.
    Warning:  PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/pgsql.so' - dlopen(/opt/local/lib/php/extensions/pgsql.so, 9): Library not loaded: /usr/lib/libpq.5.dylib
      Referenced from: /opt/local/lib/php/extensions/pgsql.so
      Reason: image not found in Unknown on line 0
    This has got to be the "missing" piece of my puzzle, but I am having no luck finding what to do about it.  I have tried making a link to the libpq.5.3.dylib with no success.
    Anyone know what I'm doing wrong?

  • Java and Postgresql

    I have a postgresql database setup on a server machine and have written a java program in netbeans that accesses it. The problem i have is that running the jar created by netbeans from any other machine on the network has really slow database access but running the program from netbeans itself is fine. Running the jar on the server machine is also fine.
    Anyoner got any idea as to why this could be?
    Tom

    I have a postgresql database setup on a server machine and have written a java program in netbeans that accesses it. The problem i have is that running the jar created by netbeans from any other machine on the network has really slow database access but running the program from netbeans itself is fine. Running the jar on the server machine is also fine.
    Anyoner got any idea as to why this could be?
    Tom

  • Device manager and Postgresql error message loop

    Hello,
    I'm on MBP 7,1, 2.4GHz Intel Core 2 Duo, 4GB DDR3 Ram, 500GB hard drive with Lion. After the v10.7.3 update, the console has been putting a looping error message regarding Device manager and PostGre SQL (below). Can anyone help?
    23/02/12 12:47:07.662 PM com.apple.launchd: (org.postgresql.postgres[1110]) Exited with code: 2
    23/02/12 12:47:07.662 PM com.apple.launchd: (org.postgresql.postgres) Throttling respawn: Will start in 10 seconds
    23/02/12 12:47:13.834 PM com.apple.devicemanager: DEBUG: Initializing DeviceManagerDaemon with ports 3320,3321,3322,3323 (physmem = 4GB)
    23/02/12 12:47:13.834 PM com.apple.devicemanager: DEBUG: Making sure Rails is configured properly
    23/02/12 12:47:13.834 PM com.apple.devicemanager: DEBUG: Running rake command: /usr/bin/rake db:migrate
    23/02/12 12:47:15.044 PM ruby: Unable to create ProfileManager log file at '/var/log/devicemgr/profilemanager.log' (No such file or directory)
    23/02/12 12:47:15.044 PM ProfileManager: Unable to create ProfileManager log file at '/var/log/devicemgr/profilemanager.log' (No such file or directory)
    23/02/12 12:47:15.045 PM com.apple.devicemanager: Feb 23 12:47:15 Computer.local ProfileManager[1116] <Error>: Unable to create ProfileManager log file at '/var/log/devicemgr/profilemanager.log' (No such file or directory)
    23/02/12 12:47:16.449 PM com.apple.devicemanager: rake aborted!
    23/02/12 12:47:16.449 PM com.apple.devicemanager: could not connect to server: No such file or directory
    23/02/12 12:47:16.449 PM com.apple.devicemanager:           Is the server running locally and accepting
    23/02/12 12:47:16.449 PM com.apple.devicemanager:           connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
    23/02/12 12:47:16.450 PM com.apple.devicemanager: (See full trace by running task with --trace)
    23/02/12 12:47:16.461 PM com.apple.devicemanager: (in /usr/share/devicemgr/backend)
    23/02/12 12:47:16.470 PM com.apple.devicemanager: /usr/share/devicemgr/backend/devicemgrd:109:in `rake': Rake command failed with 256 (RuntimeError)
    23/02/12 12:47:16.470 PM com.apple.devicemanager:           from /usr/share/devicemgr/backend/devicemgrd:103:in `setupRails'
    23/02/12 12:47:16.470 PM com.apple.devicemanager:           from /usr/share/devicemgr/backend/devicemgrd:33:in `run'
    23/02/12 12:47:16.470 PM com.apple.devicemanager:           from /usr/share/devicemgr/backend/devicemgrd:131
    23/02/12 12:47:16.470 PM com.apple.launchd: (com.apple.devicemanager[1114]) Exited with code: 1
    23/02/12 12:47:16.470 PM com.apple.launchd: (com.apple.devicemanager) Throttling respawn: Will start in 8 seconds
    23/02/12 12:47:17.682 PM org.postgresql.postgres: postgres_real cannot access the server configuration file "/var/pgsql/postgresql.conf": No such file or directory
    23/02/12 12:47:17.682 PM com.apple.launchd: (org.postgresql.postgres[1117]) Exited with code: 2
    23/02/12 12:47:17.682 PM com.apple.launchd: (org.postgresql.postgres) Throttling respawn: Will start in 10 seconds
    23/02/12 12:47:24.482 PM com.apple.devicemanager: DEBUG: Initializing DeviceManagerDaemon with ports 3320,3321,3322,3323 (physmem = 4GB)
    23/02/12 12:47:24.483 PM com.apple.devicemanager: DEBUG: Making sure Rails is configured properly
    23/02/12 12:47:24.483 PM com.apple.devicemanager: DEBUG: Running rake command: /usr/bin/rake db:migrate
    23/02/12 12:47:25.718 PM ruby: Unable to create ProfileManager log file at '/var/log/devicemgr/profilemanager.log' (No such file or directory)
    23/02/12 12:47:25.718 PM ProfileManager: Unable to create ProfileManager log file at '/var/log/devicemgr/profilemanager.log' (No such file or directory)
    23/02/12 12:47:25.718 PM com.apple.devicemanager: Feb 23 12:47:25 Computer.local ProfileManager[1121] <Error>: Unable to create ProfileManager log file at '/var/log/devicemgr/profilemanager.log' (No such file or directory)

    In case anyone else comes here looking for a solution,and the above doesn't work for them. I was trying to resolve the repeated instances of this in my log file, plus the effects of not having postgres running. I'm on OS X Lion Server, 10.7.5, on an XServe.
    org.postgresql.postgres[18789]: postgres_real cannot access the server configuration file "/var/pgsql/postgresql.conf": No such file or directory
    com.apple.launchd[1] (org.postgresql.postgres[18789]): Exited with code: 2
    com.apple.launchd[1] (org.postgresql.postgres): Throttling respawn: Will start in 10 seconds
    I ran these commands:
    sudo chmod 777 /var
    sudo mv /var/pgsql /var/pgsql.OLD
    sudo -u _postgres  /usr/bin/pg_ctl initdb -D /var/pgsql
    sudo chmod 755 /var
    This initialized the postgres setup and everything seems to be running happily now.

Maybe you are looking for