writing in oracle database with java
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.databases.oracle.misc
From:
"Stefan Seidel" <ssei... @uni-muenster.de>
Date: Fri, 29 Aug 2003 17:13:44 -0700
Local: Sat 30 Aug 2003 01:13
Subject: writing in oracle database with java
Hi NG,
i'm trying to create tables and to insert data into these tables using oracle .jdbc.
(first a "create table" statement and then couple of "insert into" statements)
There are no problems except for the last table. The table is created but the data is not inserted.
This happens regardless of if i create 3,4,5 etc. tables with the last table.
what am i doing wrong?
Stefan
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.databases.oracle.misc
From:
Daniel Morgan <damor... @exxesolutions.com>
Date: Fri, 29 Aug 2003 08:51:16 -0700
Local: Fri 29 Aug 2003 16:51
Subject: Re: writing in oracle database with java
Stefan Seidel wrote:
> Hi NG,
> i'm trying to create tables and to insert data into these tables using > oracle .jdbc.
> (first a "create table" statement and then couple of "insert into" > statements)
> There are no problems except for the last table. The table is created but > the data is not inserted.
> This happens regardless of if i create 3,4,5 etc. tables with the last > table.
> what am i doing wrong?
> Stefan
Oracle version and edition?
Code sample?
JDBC driver being used?
Crystal ball is broken.
But I would advise you to not perform DDL on-the-fly. Tables should not be built across a JDBC link as part of an application. Build them in SQL*Plus and then leave them alone. -- Daniel Morgan http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp http://www.outreach.washington.edu/extinfo/certprog/aoa/aoa_main.asp damor... @x.washington.edu (replace 'x' with a 'u' to reply)
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.databases.oracle.misc
From:
"Stefan Seidel" <ssei... @uni-muenster.de>
Date: Fri, 29 Aug 2003 17:56:52 -0700
Local: Sat 30 Aug 2003 01:56
Subject: Re: writing in oracle database with java
Sorry, thought it might be something typical...
Oralce Ver. 9.0.1 jdbc version: ojdbc 1.4
Code example:
for(int i = 0;i< hierarchie.size();i++){
// CREATE TABLE tableName = "DWH.snowflake_dim_" + i; statementString = "CREATE TABLE " +tableName + "(ID INTEGER,UEBER INTEGER)"; statement.executeUpdate(statementString); Vector ebene = (Vector)hierarchie.elementAt(i);
// INSERT INTO for(int z = 0;z < ebene.size(); z++){ statementString = "INSERT INTO "+tableName+" VALUES ("+ ((Eintrag)(ebene.elementAt(z))).id+","+ ((Eintrag)(ebene.elementAt(z))).ueber+")";
statement.executeUpdate(statementString); }
"
Daniel Morgan " <damor
... @exxesolutions.com> wrote in message
news:3F4F7674.21294305@exxesolutions.com ...
> Stefan Seidel wrote:
> > Hi NG,
> > i'm trying to create tables and to insert data into these tables using > > oracle .jdbc.
> > (first a "create table" statement and then couple of "insert into" > > statements)
> > There are no problems except for the last table. The table is created but > > the data is not inserted.
> > This happens regardless of if i create 3,4,5 etc. tables with the last > > table.
> > what am i doing wrong?
> > Stefan
> Oracle version and edition? > Code sample? > JDBC driver being used?
> Crystal ball is broken.
> But I would advise you to not perform DDL on-the-fly. Tables should not be > built across a JDBC link as part of an application. Build them in SQL*Plus > and then leave them alone. > -- > Daniel Morgan > http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp > http://www.outreach.washington.edu/extinfo/certprog/aoa/aoa_main.asp > damor... @x.washington.edu > (replace 'x' with a 'u' to reply)
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.databases.oracle.misc
From:
Rene Nyffenegger <rene.nyffeneg... @gmx.ch>
Date: 29 Aug 2003 16:59:55 GMT
Local: Fri 29 Aug 2003 17:59
Subject: Re: writing in oracle database with java
> Hi NG,
> i'm trying to create tables and to insert data into these tables using > oracle .jdbc.
> (first a "create table" statement and then couple of "insert into" > statements)
> There are no problems except for the last table. The table is created but > the data is not inserted.
> This happens regardless of if i create 3,4,5 etc. tables with the last > table.
> what am i doing wrong?
Stefan,
I'd say you forgot to commit the inserts. You see the other data because create table does an implicit commit.
hth Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.databases.oracle.misc
From:
"Maximus" <asdfasd... @eqeqweqwe.com>
Date: Fri, 29 Aug 2003 22:08:44 GMT
Local: Fri 29 Aug 2003 23:08
Subject: Re: writing in oracle database with java
"Stefan Seidel" <ssei
... @uni-muenster.de> wrote in message
news:bint5i$qla$1@redenix.uni-muenster.de ...
> Sorry, thought it might be something typical...
> Oralce Ver. 9.0.1 > jdbc version: ojdbc 1.4
> Code example:
> for(int i = 0;i< hierarchie.size();i++){
> // CREATE TABLE > tableName = "DWH.snowflake_dim_" + i; > statementString = "CREATE TABLE " +tableName + > "(ID INTEGER,UEBER INTEGER)"; > statement.executeUpdate(statementString); > Vector ebene = (Vector)hierarchie.elementAt(i);
> // INSERT INTO > for(int z = 0;z < ebene.size(); z++){ > statementString = "INSERT INTO "+tableName+" VALUES ("+ > ((Eintrag)(ebene.elementAt(z))).id+","+
((Eintrag)(ebene.elementAt(z))).ueber+")";
> statement.executeUpdate(statementString); > }
Where are the commits?
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.databases.oracle.misc
From: "Jim Kennedy" <kennedy-down_with_spammers@no_spam.comcast.net>
Date: Sat, 30 Aug 2003 02:38:38 GMT
Local: Sat 30 Aug 2003 03:38
Subject: Re: writing in oracle database with java
When he does the next create table statement. So maybe that is why he is
not seeing the last set of data, no commit. What is an uber integer?
Jim
"Maximus" <asdfasd
... @eqeqweqwe.com> wrote in message
news:M9Q3b.58367$la.1191531@news1.calgary.shaw.ca ...
> "Stefan Seidel" <ssei
... @uni-muenster.de> wrote in message
>
news:bint5i$qla$1@redenix.uni-muenster.de ...
> > Sorry, thought it might be something typical...
> > Oralce Ver. 9.0.1 > > jdbc version: ojdbc 1.4
> > Code example:
> > for(int i = 0;i< hierarchie.size();i++){
> > // CREATE TABLE > > tableName = "DWH.snowflake_dim_" + i; > > statementString = "CREATE TABLE " +tableName + > > "(ID INTEGER,UEBER INTEGER)"; > > statement.executeUpdate(statementString); > > Vector ebene = (Vector)hierarchie.elementAt(i);
> > // INSERT INTO > > for(int z = 0;z < ebene.size(); z++){ > > statementString = "INSERT INTO "+tableName+" VALUES ("+
((Eintrag)(ebene.elementAt(z))).id+","+
> ((Eintrag)(ebene.elementAt(z))).ueber+")";
> > statement.executeUpdate(statementString); > > }
> Where are the commits?
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.databases.oracle.misc
From:
"Maximus" <asdfasd... @eqeqweqwe.com>
Date: Sat, 30 Aug 2003 05:18:32 GMT
Local: Sat 30 Aug 2003 06:18
Subject: Re: writing in oracle database with java
"Jim Kennedy" <kennedy-down_with_spammers@no_spam.comcast.net> wrote in
message
news:O6U3b.301799$YN5.207911@sccrnsc01 ...
> When he does the next create table statement. So maybe that is why he is > not seeing the last set of data, no commit. What is an uber integer? > Jim
Makes sense, "executeUpdate('COMMIT')" after the inserts should fix that.
ueber integer... sounds like German for above, over, super... probably a foreign key to the parent/master?
> "Maximus" <asdfasd... @eqeqweqwe.com> wrote in message > news:M9Q3b.58367$la.1191531@news1.calgary.shaw.ca ... > > "Stefan Seidel" <ssei... @uni-muenster.de> wrote in message > > news:bint5i$qla$1@redenix.uni-muenster.de ... > > > Sorry, thought it might be something typical...
> > > Oralce Ver. 9.0.1 > > > jdbc version: ojdbc 1.4
> > > Code example:
> > > for(int i = 0;i< hierarchie.size();i++){
> > > // CREATE TABLE > > > tableName = "DWH.snowflake_dim_" + i; > > > statementString = "CREATE TABLE " +tableName + > > > "(ID INTEGER,UEBER INTEGER)"; > > > statement.executeUpdate(statementString); > > > Vector ebene = (Vector)hierarchie.elementAt(i);
> > > // INSERT INTO > > > for(int z = 0;z < ebene.size(); z++){ > > > statementString = "INSERT INTO "+tableName+" VALUES ("+
> ((Eintrag)(ebene.elementAt(z))).id+","+
> > ((Eintrag)(ebene.elementAt(z))).ueber+")";
> > > statement.executeUpdate(statementString); > > > }
> > Where are the commits?
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.databases.oracle.misc
From:
Richard Kuhler <no... @nowhere.com>
Date: Wed, 03 Sep 2003 00:16:21 GMT
Local: Wed 3 Sep 2003 01:16
Subject: Re: writing in oracle database with java
Stefan Seidel wrote:
<snip>
> for(int i = 0;i< hierarchie.size();i++){
> // CREATE TABLE > tableName = "DWH.snowflake_dim_" + i; > statementString = "CREATE TABLE " +tableName + > "(ID INTEGER,UEBER INTEGER)"; > statement.executeUpdate(statementString); > Vector ebene = (Vector)hierarchie.elementAt(i);
> // INSERT INTO > for(int z = 0;z < ebene.size(); z++){ > statementString = "INSERT INTO "+tableName+" VALUES ("+ > ((Eintrag)(ebene.elementAt(z))).id+","+ > ((Eintrag)(ebene.elementAt(z))).ueber+")";
> statement.executeUpdate(statementString); > }
<snip>
I'd recommend you switch to using bind variables (set methods). If this is a one time script you mike be ok without it but you're probably scrambling the SGA pretty good here. As for the inserts missing, the other posters are almost certainly right about the commit. Although, since JDBC connections are auto-commit by default, this would assume that you've changed it using the setAutoCommit method. That would seem to indicate that you know about commits though and just didn't do it here. Strange.
Richard Kuhler
You must
Sign in before you can post messages.
You do not have the permission required to post.