Reg : Exception ( Postgresql with Java -JDBC)

Поиск
Список
Период
Сортировка
От smitha
Тема Reg : Exception ( Postgresql with Java -JDBC)
Дата
Msg-id 20051123082744.40705.qmail@web60224.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Reg : Exception ( Postgresql with Java -JDBC)  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
 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.

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Achilleus Mantzios
Дата:
Сообщение: Re: Reg : Exception in Postgresql with Java
Следующее
От: Rob Kirkbride
Дата:
Сообщение: Switching user within connection.