我这里出了什么呢,请求给位高手帮忙看一下 这是我写的java连接oracle的程序,主要是创建了一个oracle调用java类的sql语句 
Class.forName("oracle.jdbc.driver.OracleDriver");    
          conn= DriverManager.getConnection(DBURL,"SYSTEM","SYSTEM");  
      Statement st=conn.createStatement(); 
      CallableStatement proc = null; 
      
  String sql="create or replace and compile java source named li_javaDemoee as  public class javaDemoee{} "; 
      System.out.println(sql); 
      st.execute(sql); 控制台报一下错误: 
create or replace and compile java source named li_javaDemoee as  public class javaDemoee{} 
Exception in thread "main" java.sql.SQLException: 出现不支持的 SQL92 标记: 90: 
但是我把打印出来的sql语句 
放到sql/pl里面是可以执行成功的 
SQL> create or replace and compile java source named li_javaDemoee as  public class javaDemoee { }; 
  2  / Java 已创建。 

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主截止到2008-06-21 00:02:27的汇总数据:
    注册日期:2008-6-20
    上次登录:2008-6-20
    发帖数:2                  发帖分:120                
    结贴数:0                  结贴分:0                  
    结贴率:0.00 %        结分率:0.00 %        
    如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
      

  2.   

    在执行executeXXXX()之前,请加上一句setEscapeProcessing(false);
    如:Statement stmt = conn.createStatement();
    stmt.setEscapeProcessing(false);
    stmt.executeUpdate("create or replace and compile java source named li_javaDemoee as  public class javaDemoee{} ");
    请参考Oracle的官方说明
    Disabling Escape Processing
    Escape processing for SQL92 syntax is enabled by default, which results in the JDBC driver performing escape substitution before sending the SQL code to the database. If you want the driver to use regular Oracle SQL syntax, which is more efficient than SQL92 syntax and escape processing, then use this statement: stmt.setEscapeProcessing(false);