Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: writing in oracle database with java

Re: writing in oracle database with java

From: Stefan Seidel <sseidel_at_uni-muenster.de>
Date: Fri, 29 Aug 2003 17:56:52 -0700
Message-ID: <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);
            }


"Daniel Morgan" <damorgan_at_exxesolutions.com> wrote in message news:3F4F7674.21294305_at_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
> damorgan_at_x.washington.edu
> (replace 'x' with a 'u' to reply)
>
>
Received on Fri Aug 29 2003 - 19:56:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US