Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cC40I-00039s-HQ for pgsql-jdbc@arkaria.postgresql.org; Wed, 30 Nov 2016 12:28:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cC40I-0004ee-45 for pgsql-jdbc@arkaria.postgresql.org; Wed, 30 Nov 2016 12:28:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cC40H-0004d6-N4 for pgsql-jdbc@postgresql.org; Wed, 30 Nov 2016 12:28:49 +0000 Received: from mail-ua0-x241.google.com ([2607:f8b0:400c:c08::241]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cC40F-0001Wa-8s for pgsql-jdbc@postgresql.org; Wed, 30 Nov 2016 12:28:48 +0000 Received: by mail-ua0-x241.google.com with SMTP id 50so17326006uae.2 for ; Wed, 30 Nov 2016 04:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:mime-version :content-transfer-encoding; bh=P+EYJlP9iEsYxBHnKpO6NCJe+zHaPx3DY3xXNzb7NjE=; b=VliM6yrbHrYVN5pahxIvl2GaR/C5GHT+gcn42KQDh75YwuYgkwx3SEMlnJvqjiRt4z tSjng1yu2WD5eaoiQzU2gy9kmcX2z5i8ZLeS2U49AQicaA/ev0JjyaAT8JnbdxPrVZ/4 wmXUweL/jr2Y3Hj++Ft23LDzmkYoY/Z/hb52FIYNw/iZqK9NUhAJgqN+ei3csCmMDEVB H1eKmqw2S4QJaytMGRr//0XaqDwpNUkvpVStHzwobqXOA2oW/fNOEUP5dQH+GrdqaIvq pkRTrMW7TtVwBen0pr5Fznl3/rU/MSba2h8FazNGF1RcdGot1HCNiRF1rRqLMDKMuUwL X6Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=P+EYJlP9iEsYxBHnKpO6NCJe+zHaPx3DY3xXNzb7NjE=; b=HP/oF+aoULzRyDPhVEIByT0E9tNa78y0PmUurraaXQymsaOCPpRzH1May1gw07vWvs Yv/e3Mrs3r8aQPcSxuaaVZzp3s8NCCu+PqxTwD2A+RsRg8k/566Ck5/r5MEz36nbxfYT vnfaUXrruF68Y91XfuPfZlAyYeTr+8o/ETGXjhx2q/e6k1XcwrttGsVp5deX+QDF6Jov hD0DD3mKtgs8vbBhBhbmAGL/rGWz28PGJ+nD1kCKw3Vv3fZt79r7+1vijMvv71XQtcF3 K3jT1f0bN0+MeFyPSt7yg0OgQLH48iPBi9QPwY7vx5MoyAwd/dqm0tbPzo3Cey+RvOgI FXlQ== X-Gm-Message-State: AKaTC025VIAJ+w3Yj8Jbu4fuH7bTXEe6SHXQRDp+FShasS2Nkn73axr33gOYrKnCbDpe7Q== X-Received: by 10.159.48.91 with SMTP id i27mr24512695uab.13.1480508926007; Wed, 30 Nov 2016 04:28:46 -0800 (PST) Received: from roblaptop ([2804:14d:baa0:8560:461e:a1ff:fe19:c7bd]) by smtp.gmail.com with ESMTPSA id c124sm13185898vkh.17.2016.11.30.04.28.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Nov 2016 04:28:45 -0800 (PST) Message-ID: <1480508922.5197.0.camel@gmail.com> Subject: Re: Database reset connection From: rob stone To: Manoj Palhade , pgsql-jdbc@postgresql.org Date: Wed, 30 Nov 2016 23:28:42 +1100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On Wed, 2016-11-30 at 16:48 +0530, Manoj Palhade wrote: > Hi, > > I have Java class which implements the Database(Postgres) related > functionality. > > The problem is if Database stopped and then restart then My this > class throws SQLException as connection got reset(database is up and > running). > > Is there any way that after Database restarted; my class > automatically Connection to database and work as expected instead of > throwing SQLException. > > Is there anyway with Properties as a parameter to > DriverManager.getConnection(). > > Thanks and Regards, > > Manoj Palhade >