[JDBC] Jbuilder Question..

2001-05-08 Thread Thys De [EMAIL PROTECTED]

Anybody have some sort of fix for jbuilder4 enterprise not displaying the
tables in my db.. 
I'm using postgres 7.1 and the 7.0-1.2 jar file ..


Please help ..

Thanx

Thys de Wet
[mailto:[EMAIL PROTECTED]]

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[JDBC] AGAIN: still no answer ... peter, or anybody knowledgeable, please ....

2001-05-08 Thread Mark Rosa

dear all,

unfortunately the jdbc1 driver can't be compiled.
there are several errors popping up when compiling --with-java and also 
when i try to compile the jdbc interface individually:

i already figured out two mistypings in the Statement.java file in 
src/interfaces/jdbc/org/postgresql/jdbc1/Statement.java

1. in the first line peter wrote 'nackage' instead of 'package'
2. on line 291 peter wrote
if (result != null  ((org.postgresql.ResultSet)result.reallyResultSet())
instead of
if (result != null  ((org.postgresql.ResultSet)result).reallyResultSet())

but after correcting these misspellings i still got error messages that 
i couldn't correct any more with my limited knowledge of java:

/prog/ant/bin/ant -buildfile ../../../build.xml -Dmajor=7 -Dminor=1 
-Dfullversion=7.1 -Ddef_pgport=5432
Buildfile: ../../../build.xml

jar:

call:

prepare:

check_versions:

driver:
  [echo] Configured build for the JDBC1 edition driver.

compile:
  [copy] Copying 4 files to 
/disk/raid2/SRC/postgresql-7.1/src/interfaces/jdbc/build

examples:
 [javac] Compiling 1 source file to 
/disk/raid2/SRC/postgresql-7.1/src/interfaces/jdbc/build
 [javac] 
/disk/raid2/SRC/postgresql-7.1/src/interfaces/jdbc/example/blobtest.java:189: 
Class example.Blob not found in type declaration.
 [javac] Blob b = rs.getBlob(a);
 [javac] ^
 [javac] 
/disk/raid2/SRC/postgresql-7.1/src/interfaces/jdbc/example/blobtest.java:189: 
Method getBlob(java.lang.String) not found in interface java.sql.ResultSet.
 [javac] Blob b = rs.getBlob(a);
 [javac]^
 [javac] 2 errors

BUILD FAILED

/disk/raid2/SRC/postgresql-7.1/src/interfaces/jdbc/build.xml:120: 
Compile failed, messages should have been provided.

Total time: 2 seconds
gmake[3]: *** [all] Error 1
gmake[3]: Leaving directory 
`/disk/raid2/SRC/postgresql-7.1/src/interfaces/jdbc'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/disk/raid2/SRC/postgresql-7.1/src/interfaces'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/disk/raid2/SRC/postgresql-7.1/src'
gmake: *** [all] Error 2

can anybody help me along, or could peter put the jar package of the 
jdbc1 on his web-site, please.

if someone would send me the jar-package by mail, i would be happy also 
[:-)]

thanks for your help,

mark rosa

ps: btw. i tried this both on redhat-linux7.1 (java version 1.1.8) and 
irix6.5.9m (java version 3.2 (Sun 1.1.8))

-- 
-
Mark Rosa - Dipl. Arch. ETH
Etekt Inc.co-create your home
phone: ++41-1-4462-406  www: http://www.etekt.com
mobile: ++41-76-390 06 37   fax: ++49-89-244 35 64 08
email: [EMAIL PROTECTED]   www: http://www.yourcell.net/rosa
-

The information transmitted is intended only for the person
or entity to which it is addressed and may contain confi-
dential and/or privileged material. Any review, retrans-
mission, dissemination or other use of, or taking of any
action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[JDBC] Why?? executeQuery() exception: No results were returned by the query.

2001-05-08 Thread Panu Outinen

Hi there !

Can anyone explain why does executeQuery() throws an exception
No results were returned by the query.
when result set is empty ???

In my opinion (and also e.g. Oracle's JDBC driver's opinion) that this is 
just normal and user can check the number of rows (=0) that none was 
returned. It's totally different to make a query where something is wrong 
in the query itself e.g. non-existant column is used or perhaps in the 
database connection!

This is pain in the *ss to test against in one's code for every different 
JDBC driver's DIFFERENT return string there available and it's impossible 
to do code that works for even unknown drivers. And Postgresql has even 
language dependant versions of this !!!

Since Postgresql source code is so nicely publicly available (thank you all 
there!) and thus improvements are easily given by anyone I just wonder if 
this could be improved, please !!!

   - Panu

PS. I know for sure that at least SQL Server throws the following when used 
through JDBC-ODBC bridge: No ResultSet was produced.


--

org\postgresql\jdbc2\Statement.java:

...
/**
 * Execute a SQL statement that retruns a single ResultSet
 *
 * @param sql typically a static SQL SELECT statement
 * @return a ResulSet that contains the data produced by the query
 * @exception SQLException if a database access error occurs
 */
public java.sql.ResultSet executeQuery(String sql) throws SQLException
{
this.execute(sql);
while (result != null  
!((org.postgresql.ResultSet)result).reallyResultSet())
result = ((org.postgresql.ResultSet)result).getNext();
if (result == null)
throw new PSQLException(postgresql.stat.noresult);
return result;
}
...

--


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[JDBC] Re: AGAIN: still no answer ... peter, or anybody knowledgeable,please ....

2001-05-08 Thread Michael Stephenson

 The current CVS sources look wrong to me.  It has:

   if (result != null)  ((org.postgresql.ResultSet)result.reallyResultSet())

 Shouldn't this be:

   if (result != null  ((org.postgresql.ResultSet)result.reallyResultSet()))

 Not sure if the extra parens are needed for:

   if (result != null  ((org.postgresql.ResultSet)result).reallyResultSet())

 Comments?

The extra parenthesis are required (since java.sql.ResultSet doesn't
have a method 'reallyResultSet()' which returns an object which can be
succesfully cast as a 'org.postgresql.ResultSet), but I think it would be
cleaner just to declare 'result' as 'org.postgresql.ResultSet' on line 27,
that way none of the messy casts (of which there are 11) would be
required..

Michael xxx


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[JDBC] JDBC Download.

2001-05-08 Thread Thys De [EMAIL PROTECTED]

Can anyone please tell me wehere I can get the jdbc 7.1 jar .. frustration
I only seem to find the 7.0-1.2 jars .. /frustration

Thanx
Thys de Wet


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[JDBC] No results exception on insert

2001-05-08 Thread Brian_Williams

Hello,

I have some code which is essentially doing the following:

Statement stmt;
ResultSet rs = stmt.executeQuery(insert into users values ( 'joe', 'blow'
));

The values are inserted into the table correctly.  I verified this using
psql:
select * from users.

The problem is that the executeQuery throws an Exception.  The message
is No results were returned by the query:

No results were returned by the query.
at org.postgresql.jdbc2.Statement.executeQuery(Statement.java,
Compiled
Code)

My driver is org.postgresql.Driver from the jar file jdbc7.0-1.2.jar.  I
think
the port version is 7.1  The platform is FreeBSD 4.2-RELEASE.
I am using linux jdk 1.2.2.

Can anyone give me any ideas?

Thanks,
Brian



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [JDBC] No results exception on insert

2001-05-08 Thread Mike D'Agosta


Statement stmt;
ResultSet rs = stmt.executeQuery(insert into users values ( 'joe', 'blow'
));

The problem is that the executeQuery throws an Exception.  The message
is No results were returned by the query:

Try executeUpdate() for insert, create and delete.

Mike


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [JDBC] No results exception on insert

2001-05-08 Thread Jeremy Buchmann

[EMAIL PROTECTED] wrote:

 Hello,
 
 I have some code which is essentially doing the following:
 
 Statement stmt;
 ResultSet rs = stmt.executeQuery(insert into users values ( 'joe', 'blow'
 ));
 
 The values are inserted into the table correctly.  I verified this using
 psql:
 select * from users.
 
 The problem is that the executeQuery throws an Exception.  The message
 is No results were returned by the query:
 
 No results were returned by the query.
 at org.postgresql.jdbc2.Statement.executeQuery(Statement.java,
 Compiled
 Code)


Hi,

When you're using INSERT, UPDATE, or DELETE, you should use the 
executeUpdate() method of JDBC.  executeQuery expects results because it 
assumes a query is being sent.  :)

HTH,
Jeremy


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[JDBC] Is DataSource implemented?

2001-05-08 Thread Larry Mulcahy

Referring back to 
http://fts.postgresql.org/db/mw/msg.html?mid=82946,
I tried to use [org.]postgresql.PostgresqlDataSource
but could not find it in 
/usr/local/pgsql/share/java/postgresql.jar, created
today by compiling PostgreSQL 7.1.1 from the sources.

When I list postgresql.jar with 
jar tvf /usr/local/pgsql/share/java/postgresql.jar,
it has the other classes that are supposed to be 
under org.postgresql:

 12171 Tue May 08 15:48:50 MDT 2001 org/postgresql/Connection.class
  4332 Tue May 08 15:48:50 MDT 2001 org/postgresql/PG_Stream.class
  4204 Tue May 08 15:48:50 MDT 2001 org/postgresql/Driver.class
  2836 Tue May 08 15:48:50 MDT 2001 org/postgresql/Field.class
  2440 Tue May 08 15:48:50 MDT 2001 org/postgresql/ResultSet.class
   347 Tue May 08 15:48:52 MDT 2001 org/postgresql/Statement.class

but not PostgresqlDataSource.

I can see PostgresqlDataSource.java
sitting there in src/interfaces/jdbc/org/postgresql,
but it's not being compiled and finding its way into the
.jar file.

I see in postgresql-7.1.1/src/interfaces/jdbc/Implementation
this provocative hint:

PostgresqlDataSource
Exists in the Java2 Enterprise edition driver only and
is the
enterprise equivalent to Driver

What do I need to do to get the DataSource class?  Build
with some J2EE stuff?

-- 
Larry Mulcahy   [EMAIL PROTECTED]
  PGP public key at:
   http://pgpkeys.mit.edu:11371/pks/lookup?op=getsearch=0x2C4C5A03

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html