Re: Overwriting a Access Database using JDBC
From: Alan Gutierrez (alan_at_engrm.com)
Date: 02/06/05
- Next message: Aquila Deus: "Re: Could someone good to see the programming archtecture?"
- Previous message: Alan Gutierrez: "Re: Can UPDATE be used for populating DB using JDBC"
- In reply to: Steve Sobol: "Re: Overwriting a Access Database using JDBC"
- Next in thread: Steve Sobol: "Re: Overwriting a Access Database using JDBC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 06 Feb 2005 01:44:52 -0600
On 2005-02-06, Steve Sobol <sjsobol@JustThe.net> wrote:
> alan@ljubljana.agtrz.com wrote:
>
>> I'm not familiar with JDBC, co I can't comment on the Java.
>>
>> But...
>>
>> No stack trace?
>>
>> The UPDATE statement will update every row in the database, by the way.
> But the Java code looks OK.
Okay, Tushar.
You are not updating any rows if rs is zero. You're probably
running your application for the first time. No rows, no update.
Have you tryed playing around with SQL in Access, or using one
of the many JDBC shell utitities. SQL is really easy stuff.
-- create table foo --
CREATE TABLE foo (bar integer, baz varchar(32));
-- delete all rows in foo --
DELETE FROM foo;
-- Add a row to foo --
INSERT INTO foo (bar, baz) VALUES (1, "fred");
-- Update foo --
UPDATE foo set baz = "barney" WHERE bar = 1;
-- get rid table foo entrely --
DROP TABLE foo;
You'll generally find that you have to write update and insert
statements for all the data in your database. It will feel
redundant until you get used to it.
As someone else noted, optional in the documentation means
optional the same way that import declarations are optional in
java. If you don't put them there, that's fine, but you can use
any classes external to the package. Make sense?
You really ought to slow down and read an SQL primer. If you are
really in a hurry, just serialize your objects to a file for now.
Good luck.
-- Alan Gutierrez - alan@engrm.com
- Next message: Aquila Deus: "Re: Could someone good to see the programming archtecture?"
- Previous message: Alan Gutierrez: "Re: Can UPDATE be used for populating DB using JDBC"
- In reply to: Steve Sobol: "Re: Overwriting a Access Database using JDBC"
- Next in thread: Steve Sobol: "Re: Overwriting a Access Database using JDBC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|