X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 40DC4DAC45 for ; Wed, 23 Nov 2005 04:27:46 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83070-06 for ; Wed, 23 Nov 2005 08:27:46 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from web60224.mail.yahoo.com (web60224.mail.yahoo.com [209.73.178.112]) by svr1.postgresql.org (Postfix) with SMTP id 6D86CD719A for ; Wed, 23 Nov 2005 04:27:43 -0400 (AST) Received: (qmail 40707 invoked by uid 60001); 23 Nov 2005 08:27:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=k7hFKD53sTfRW6SKcLvAcnbGQlGlYSAkv/3nyRZF8X/UFrTEUYxRwnl/YvMGhvw58LacXWTP8hxL+PqzqspOFlbM1ZNd+19ne2bDJiTB5zFMtdoO3Ke9KuzPk5HR7a3rH2Zoi41iKjDOFytgqA+8UO3Z/EZOnlGwOsaOBuUuM64= ; Message-ID: <20051123082744.40705.qmail@web60224.mail.yahoo.com> Received: from [164.100.167.130] by web60224.mail.yahoo.com via HTTP; Wed, 23 Nov 2005 00:27:44 PST Date: Wed, 23 Nov 2005 00:27:44 -0800 (PST) From: smitha Subject: Reg : Exception ( Postgresql with Java -JDBC) To: pgsql-jdbc@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1135927956-1132734464=:37114" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.44 required=5 tests=[AWL=-0.040, DNS_FROM_RFC_ABUSE=0.479, HTML_MESSAGE=0.001] X-Spam-Score: 0.44 X-Spam-Level: X-Archive-Number: 200511/159 X-Sequence-Number: 14257 --0-1135927956-1132734464=:37114 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit This is my Java Program. I get connected with the Postgresql Database and the query get executed and it affects in the Database.....A new user is created in the Database.. But i am getting the Exception "No result were returned by the query" what could be the reason.....Plz tell me // .java - example connection to a Postgresql (Database) import java.io.*; import java.sql.*; public class connect { public static String villageName = null; public static final boolean DEBUG = false; public static void main (String[] args) { //Get a Connection to Postgres try { Class.forName("org.postgresql.Driver"); } catch (ClassNotFoundException e) { System.err.println( "Driver not found: " + e + "\n" + e.getMessage() ); } try { String url="jdbc:postgresql://10.163.2.95:5432/collabland"; Connection con=DriverManager.getConnection(url,"postgres","postgres"); Statement st=con.createStatement(); String logName = "kala"; String passwd = "kala"; String query1 = "CREATE user " + logName + " with password '" + passwd + "' createuser"; ResultSet rs= st.executeQuery(query1); System.out.println(query1); System.out.println("user created"); } catch (SQLException sqlex) { if (DEBUG) sqlex.printStackTrace(); System.out.println(sqlex.getMessage()); // return false; } System.out.println("after catch block"); } } --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. --0-1135927956-1132734464=:37114 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
 This is my Java Program.  I get connected with the Postgresql Database and the query get executed and it affects in the Database.....A new user is created in the Database.. But i am getting the Exception "No result were returned by the query"  what could be the reason.....Plz tell me


// .java - example connection to a Postgresql (Database)

import java.io.*;
import java.sql.*;

public class connect
{
    public static String villageName = null;
    public static final boolean DEBUG = false;

    public static void main (String[] args)
    {
        //Get a Connection to Postgres
        try
        {
            Class.forName("org.postgresql.Driver");
        }
        catch (ClassNotFoundException e)
        {
            System.err.println( "Driver not found: " + e + "\n" + e.getMessage() );
        }
        try
        {
            String url="jdbc:postgresql://10.163.2.95:5432/collabland";
            Connection con=DriverManager.getConnection(url,"postgres","postgres");
            Statement st=con.createStatement();
 
    String logName = "kala";
    String passwd = "kala";
   
  &nb sp; String  query1 = "CREATE user " + logName + " with password '" + passwd + "' createuser";
            ResultSet rs= st.executeQuery(query1);
       System.out.println(query1);
       System.out.println("user created");
        }
        catch (SQLException sqlex)
            {
                if (DEBUG) sqlex.printStackTrace();
               System.out.println(sqlex.getMessage());
             //  return false;
            }
               System.out.println("after catch block");

           }
}


Yahoo! FareChase - Search multiple travel sites in one click. --0-1135927956-1132734464=:37114--