Re: JDBC update wont, plz help.

From: Barry Lind <barry(at)xythos(dot)com>
To: Vic Cekvneich <vic(at)proj(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC update wont, plz help.
Date: 2001-09-26 20:28:24
Message-ID: 3BB23A68.3050301@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

Vic,

Can you post the errors you are getting for both the build problem and
the runtime problem you originally reported?

Without the exact errors you are getting, I can only guess at the
problems you are encountering. But my guess as to your original problem
is that your code is trying to use updateable result sets which the
driver does not support.

I wouldn't bother trying to build the EE version of the driver. It
doesn't have very much additional functionality (it only impliments a
small subset of javax.sql), and I doubt that is the source of your
original problem.

thanks,
--Barry

Vic Cekvneich wrote:

> I downloaded the 7.13 src and did a JDBC build using J2EE 13, to get the
> sqlX package.
> The build failed with errors.
>
> Is there someone who can make a build with sqlX java (must have J2EE SDK
> enviroment) ?
> Help...... please....
> Vic
>
> Vic Cekvenich wrote:
>
>> I am dead in the water....
>> > I used a driver from http://jdbc.fastcrypt.com/ , the latest driver I
>>
>>> could find w/ JDK1.3 and a simple CachedRowSet from SUN Devlopers
>>> connection.
>>>
>>> It will not update via AcceptChages.
>>> Error is This methos is not yet implementd.
>>>
>>> Can someone help me update a tabe using JDBC plz? Please cc
>>> vic(at)proj(dot)com(dot)
>>>
>>> TIA,
>>> Vic
>>>
>>> PS:
>>> My source code:
>>>
>>> import sun.jdbc.rowset.*;
>>> // get it from Java Developer's Connection
>>> // or look at Appendix Download
>>> import java.sql.*;
>>> import org.postgresql.*;
>>>
>>> public class pimRDB {
>>> public static void main (String args[])
>>> {
>>> try
>>> {
>>>
>>> CachedRowSet crs = new CachedRowSet();
>>> // row set is better than ResultSet,
>>> // configure driver, read more in book JDBC Database Access :
>>> Class.forName("org.postgresql.Driver");
>>> crs.setUrl("jdbc:postgresql://localhost/template1");
>>> // yours should not be localhost, but
>>> //an IP address of DBS server. The 5432 is the IP port
>>> crs.setUsername("sysdba");
>>>
>>> crs.setPassword("sysdba");
>>>
>>> //select
>>> crs.setCommand("select NAM from NAM where PK = ?");
>>> crs.setTableName("NAM");
>>> // use your field names
>>> crs.setInt(1, 8);
>>>
>>> // pass the first argument to the select command to
>>> // retrieve PK id of Name #8, the 8th name entered
>>> crs.execute();
>>> crs.next();
>>>
>>> //get the field value
>>> String nam = crs.getString("NAM");
>>> System.out.println(nam);
>>> // repeat
>>> crs.updateString("NAM","Vic");
>>> crs.acceptChanges();
>>> //select
>>> crs.setCommand("select NAM from NAM where PK = ?");
>>> // use your field names
>>> crs.setInt(1, 8);
>>> // pass the first argument to the select command to
>>> // retrieve PK id of Name #8, the 8th name entered
>>> crs.execute();
>>> crs.next();
>>>
>>> //get the field value
>>> nam = crs.getString("NAM");
>>> System.out.println(nam);
>>>
>>> } // try
>>> catch (Exception e) {System.out.println(e);} // catch
>>> }// main
>>> }// class
>>> //Optional: Make the program take an argument
>>> //of the PK for the record it should retrieve
>>>
>>>
>>>
>>
>>
>>
>> ---------------
>>
>>
>>
>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 2: you can get off all lists at once with the unregister command
>> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Murray Hobbs 2001-09-26 20:30:49 Multibyte design issue
Previous Message jcd@sita 2001-09-26 20:17:46 Connection to database 'template1' failed.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nick Fankhauser 2001-09-26 20:47:54 sequences in JDBC
Previous Message Mihai Gheorghiu 2001-09-26 19:03:45 Re: OS version for driver