Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> 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 Received on Tue Sep 02 2003 - 19:16:21 CDT
![]() |
![]() |