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 -> Problems Creating Java Source Through ODBC... ORA-29542

Problems Creating Java Source Through ODBC... ORA-29542

From: TimMcConechy <tjm_at_runtime.dk>
Date: 5 Jul 2003 03:22:53 -0700
Message-ID: <7afae186.0307050222.5a23be7b@posting.google.com>


Hi,

I need to create a program that sets up the necessary server code in the database by running various scripts. It now works for all objects
except JAVA SOURCE objects.

The following sample code in VFP/VB
lcsql='create or replace and compile java source named

DeleteFile'+chr(10)
lcsql=lcsql+'as'+chr(10)
lcsql=lcsql+'import java.io.*;'+chr(10)
lcsql=lcsql+'public class DeleteFile'+chr(10)
lcsql=lcsql+'    {'+chr(10)
lcsql=lcsql+'    public static void DoDelete(String FilePath) throws
Exception'+chr(10)
lcsql=lcsql+'    {'+chr(10)
lcsql=lcsql+'       File NewFile = new File(FilePath);'+chr(10)
lcsql=lcsql+'       NewFile.delete();'+chr(10)
lcsql=lcsql+'   }'+chr(10)
lcsql=lcsql+'  }'+chr(10)

**lcsql=lcsql+'/'+chr(10)

lnerror=SQLEXEC(h,lcsql)
IF lnerror=-1

        ?MESSAGE()
ENDIF Give the error:
Connectivity error: [Oracle][ODBC][Ora]ORA-29542: class DeleteFile already defined by source DeleteFile

However, Running the same code in sqlplus: SQL> create or replace and compile java source named "DeleteFile"   2 as
  3 import java.io.*;
  4

  5      public class DeleteFile
  6      {
  7      public static void DoDelete(String FilePath) throws Exception
  8      {
  9   //Delete FilePath 
 10         File NewFile = new File(FilePath);
 11         NewFile.delete();
 12     }

 13 }
 14 /

Java created.

Works fine...

I'm a little confused about the error message and confess I cant seem to figure out how to find this "already defined source"?

Does anyone have any ideas here? Received on Sat Jul 05 2003 - 05:22:53 CDT

Original text of this message

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