Hello Kiril,<div><br></div><div>I'm afraid i'm not using a connection pooling, just an static way to load the drivers</div><div><br></div><div><div>public class PgSQLDBConn {</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">       </span>static {</div>

<div><span class="Apple-tab-span" style="white-space:pre">              </span>try {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>Class.forName("org.postgresql.Driver");</div><div><br></div><div>

<span class="Apple-tab-span" style="white-space:pre">         </span>} catch (Exception e) {</div><div><span class="Apple-tab-span" style="white-space:pre">                      </span>System.out.println(e.getMessage());</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>}</div>

<div><span class="Apple-tab-span" style="white-space:pre">      </span>}</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">  </span>public Connection getConnection() {</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>Connection connection = null;</div>

<div><span class="Apple-tab-span" style="white-space:pre">              </span>try {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/db_gpstracker","MYUSER","MYPWD");</div>

<div><span class="Apple-tab-span" style="white-space:pre">              </span>} catch (Exception e) {</div><div><span class="Apple-tab-span" style="white-space:pre">                      </span>System.out.println(e.getMessage());</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>}</div>

<div><span class="Apple-tab-span" style="white-space:pre">              </span>return connection;</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>}</div><div>}</div><div><br></div></div><div>I call the method getConnection each time i want to connect to the database, execute the statements and then i close the connection (repeat each time i receive some data from the GPS device)</div>

<div><br></div><div>Best regards</div><div><br></div><div>Fernando<br><br><div class="gmail_quote">On Wed, Nov 11, 2009 at 3:10 PM, Kirill Zinov <span dir="ltr"><<a href="mailto:kirill.zinov@gmail.com">kirill.zinov@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Fernando,<br>
<br>
I think this is java application design problem. I don't use PostGIS with Java but Postgres works perfectly for me.<br>
<br>
Do you use connection pooling?<br><font color="#888888">
<br>
Kirill,</font><div class="im"><br>
<br>
Fernando Tong wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for your repplies.<br>
<br>
Yes, Rob, i'm connecting and disconnecting every time. Here some part of the logs, sorry if it's a noob question but why when the connection is received the port number is increasing? it starts in 3668 and the next connection is 3669 and so on<br>


<br>
</blockquote>
<br></div><div><div></div><div class="h5">
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>