SQLJ Translator

Hi all,
I'm getting the following error while
trying to translate using sqlj from
the prompt.
Error:Error in Sqlj Stub: path or file
name "java" not found.
what could be the problem ?Is it bcoz of installation problem ??Plz help me .

From what you can get from
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
, you have serveral options:
1. Use SQLJ 9i releases.
2. Use JPub 10g releases, where sqlj command line can be accessed through jpub command, such as
% jpub -sqlj a.sqlj a.java
Note you need to setup classpath to include translator.jar and runtime12.jar.
3. Use jpub 10g and sqlj/bin/sqlj.exe from SQLJ 9i

Similar Messages

  • SQLJ Translation does not create profile file

    SQLJ Translation does not create profile file.
    After translating a small file HelloWorld.sqlj
    the following files are created:
    HelloWorld_SJProfileKeys.class
    HelloWorld.class
    HelloWorld.java
    Although there is a HelloWorld_SJProfileKeys.class, profile file HelloWorld_SJProfile0.ser has NOT been created.
    The starting file .sqlj file HelloWorld.sqlj is taken from O'Reilly book 'Java Programming with Oracle SQLJ' by Jason Price. The file contains a valid SQL statement to display the date.
    My environment variables were set up with instructions from:
    http://www.onjava.com/pub/a/onjava/2001/12/05/learning_sqlj.html
    When I run java HelloWorld to run the .java file, I get the error:
    SQLException java.sql.SQLException: profile HelloWorld_SJProfile0 not found: java.lang.ClassNotFoundException: HelloWorld_SJProfile0
    I searched the internet high and low for a similar error to mine but I could not find a match.
    I read the following text from http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#translationerrors
    but it does not help me.
    "ClassNotFoundException: xxx.yyy_SJProfile0 for class xxx.yyy_SJProfileKeys
    If you see an exception such as:
    java.sql.SQLException: profile xxx.yyy_SJProfile0 not found:
    java.lang.ClassNotFoundException:
    xxx.yyy_SJProfile0 for class xxx.yy_SJProfileKeys
    then you must ensure that the SQLJ profile(s), such as xxx/yyy_SJProfile0.ser, is available in the SQLJ runtime environment. This includes JARing this file as part of an applet deployment, or publishing it to the server via loadjava.
    Any ideas? Thanks in advance,
    John
    Helloworld.sqlj before translation:
    The program HelloWorld.sqlj illustrates how to connect to a
    database, and display the words "Hello World" along with
    the current date.
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orac",
    "scott",
    "tiger"
    // get the current date from the database
    #sql { SELECT sysdate INTO :current_date FROM dual };
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    HelloWorld.java after translation:
    /*@lineinfo:filename=HelloWorld*//*@lineinfo:user-code*//*@lineinfo:1^1*//*
    The program HelloWorld.sqlj illustrates how to connect to a
    database, and display the words "Hello World" along with
    the current date.
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orcl",
    "scott",
    "tiger"
    // get the current date from the database
    /*@lineinfo:generated-code*//*@lineinfo:28^7*/
    // #sql { SELECT sysdate  FROM dual  };
    sqlj.runtime.profile.RTResultSet __sJT_rtRs;
    sqlj.runtime.ConnectionContext __sJT_connCtx = sqlj.runtime.ref.DefaultContext.getDefaultContext();
    if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_CONN_CTX();
    sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext();
    if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX();
    synchronized (__sJT_execCtx) {
    sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelloWorld_SJProfileKeys.getKey(0), 0);
    try
    sqlj.runtime.profile.RTResultSet __sJT_result = __sJT_execCtx.executeQuery();
    __sJT_rtRs = __sJT_result;
    finally
    __sJT_execCtx.releaseStatement();
    try
    sqlj.runtime.ref.ResultSetIterImpl.checkColumns(__sJT_rtRs, 1);
    if (!__sJT_rtRs.next())
    sqlj.runtime.error.RuntimeRefErrors.raise_NO_ROW_SELECT_INTO();
    current_date = __sJT_rtRs.getDate(1);
    if (__sJT_rtRs.next())
    sqlj.runtime.error.RuntimeRefErrors.raise_MULTI_ROW_SELECT_INTO();
    finally
    __sJT_rtRs.close();
    /*@lineinfo:user-code*//*@lineinfo:28^58*/
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    }/*@lineinfo:generated-code*/class HelloWorld_SJProfileKeys
    private static HelloWorld_SJProfileKeys inst = null;
    public static java.lang.Object getKey(int keyNum)
    throws java.sql.SQLException
    if (inst == null)
    inst = new HelloWorld_SJProfileKeys();
    return inst.keys[keyNum];
    private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass());
    private java.lang.Object[] keys;
    private HelloWorld_SJProfileKeys()
    throws java.sql.SQLException
    keys = new java.lang.Object[1];
    keys[0] = sqlj.runtime.ref.DefaultContext.getProfileKey(loader, "HelloWorld_SJProfile0");
    }

    SQLJ Translation does not create profile file.
    After translating a small file HelloWorld.sqlj
    the following files are created:
    HelloWorld_SJProfileKeys.class
    HelloWorld.class
    HelloWorld.java
    Although there is a HelloWorld_SJProfileKeys.class, profile file HelloWorld_SJProfile0.ser has NOT been created.
    The starting file .sqlj file HelloWorld.sqlj is taken from O'Reilly book 'Java Programming with Oracle SQLJ' by Jason Price. The file contains a valid SQL statement to display the date.
    My environment variables were set up with instructions from:
    http://www.onjava.com/pub/a/onjava/2001/12/05/learning_sqlj.html
    When I run java HelloWorld to run the .java file, I get the error:
    SQLException java.sql.SQLException: profile HelloWorld_SJProfile0 not found: java.lang.ClassNotFoundException: HelloWorld_SJProfile0
    I searched the internet high and low for a similar error to mine but I could not find a match.
    I read the following text from http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#translationerrors
    but it does not help me.
    "ClassNotFoundException: xxx.yyy_SJProfile0 for class xxx.yyy_SJProfileKeys
    If you see an exception such as:
    java.sql.SQLException: profile xxx.yyy_SJProfile0 not found:
    java.lang.ClassNotFoundException:
    xxx.yyy_SJProfile0 for class xxx.yy_SJProfileKeys
    then you must ensure that the SQLJ profile(s), such as xxx/yyy_SJProfile0.ser, is available in the SQLJ runtime environment. This includes JARing this file as part of an applet deployment, or publishing it to the server via loadjava.
    Any ideas? Thanks in advance,
    John
    Helloworld.sqlj before translation:
    The program HelloWorld.sqlj illustrates how to connect to a
    database, and display the words "Hello World" along with
    the current date.
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orac",
    "scott",
    "tiger"
    // get the current date from the database
    #sql { SELECT sysdate INTO :current_date FROM dual };
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    HelloWorld.java after translation:
    /*@lineinfo:filename=HelloWorld*//*@lineinfo:user-code*//*@lineinfo:1^1*//*
    The program HelloWorld.sqlj illustrates how to connect to a
    database, and display the words "Hello World" along with
    the current date.
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orcl",
    "scott",
    "tiger"
    // get the current date from the database
    /*@lineinfo:generated-code*//*@lineinfo:28^7*/
    // #sql { SELECT sysdate  FROM dual  };
    sqlj.runtime.profile.RTResultSet __sJT_rtRs;
    sqlj.runtime.ConnectionContext __sJT_connCtx = sqlj.runtime.ref.DefaultContext.getDefaultContext();
    if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_CONN_CTX();
    sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext();
    if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX();
    synchronized (__sJT_execCtx) {
    sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelloWorld_SJProfileKeys.getKey(0), 0);
    try
    sqlj.runtime.profile.RTResultSet __sJT_result = __sJT_execCtx.executeQuery();
    __sJT_rtRs = __sJT_result;
    finally
    __sJT_execCtx.releaseStatement();
    try
    sqlj.runtime.ref.ResultSetIterImpl.checkColumns(__sJT_rtRs, 1);
    if (!__sJT_rtRs.next())
    sqlj.runtime.error.RuntimeRefErrors.raise_NO_ROW_SELECT_INTO();
    current_date = __sJT_rtRs.getDate(1);
    if (__sJT_rtRs.next())
    sqlj.runtime.error.RuntimeRefErrors.raise_MULTI_ROW_SELECT_INTO();
    finally
    __sJT_rtRs.close();
    /*@lineinfo:user-code*//*@lineinfo:28^58*/
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    }/*@lineinfo:generated-code*/class HelloWorld_SJProfileKeys
    private static HelloWorld_SJProfileKeys inst = null;
    public static java.lang.Object getKey(int keyNum)
    throws java.sql.SQLException
    if (inst == null)
    inst = new HelloWorld_SJProfileKeys();
    return inst.keys[keyNum];
    private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass());
    private java.lang.Object[] keys;
    private HelloWorld_SJProfileKeys()
    throws java.sql.SQLException
    keys = new java.lang.Object[1];
    keys[0] = sqlj.runtime.ref.DefaultContext.getProfileKey(loader, "HelloWorld_SJProfile0");
    }

  • SQLJ translator for ISO/ANSI does not create .SER profile (Jdev 9.0.0 prev)

    The SQLJ translater that comes with JDeveloper 9.0.3 preview does not create profiles (.SER) when running with -codegen=ansi or iso. Thus producing none runnable code.
    It is not possible to set any switches in JDev.
    Previous versions of the translated did produce the .SER files.
    Is there a workaround possible?
    Thanks,
    Robert

    Fo the answer and a workaround look here:
    Re: A field is missing in my table.....
    -Robert

  • SQLJ translator for ISO/ANSI does not create .SER profile (Jdev 9.0.3 prev)

    The SQLJ translater that comes with JDeveloper 9.0.3 preview does not create profiles (.SER) when running with -codegen=ansi or iso. Thus producing none runnable code.
    It is not possible to set any switches in JDev.
    Previous versions of the translated did produce the .SER files.
    Is there a workaround possible?
    Thanks,
    Robert
    P.S.: I posted this also in the SQLJ forum.

    Robert,
    My mistake - you are correct, the change I mentioned was put in just after the Preview Release. The .ser files will go into the project source directory in the Preview Release. But this should be the same behavior as in previous releases - are you seeing a difference in behavior between a past release and the Preview Release? Everything up to and including the 9.0.3 Preview Release should put the .ser files in the project source directory. When the 9.0.3 Production Release is available, they will be put into the project output directory instead.
    The fix to put the .ser files into the output directory is not in the translator.jar file. It is in the core JDeveloper code (in jdev.jar). So unfortunately it is not a fix that could be easily dropped into the Preview Release. However, it will be available in the 9.0.3 Production Release.
    -Matt Hawkins, JDeveloper Team

  • JDev specifying SQLJ translator command line options

    Hi,
    I have come across the problem of SQLJ connections caching up to 5 sql commands and so leaving any related cursors open. This is happening mainly for statments where I have executed a SELECT ... INTO ... Any sqlj with iterators, I have closed the iterators so they do get removed and their cursors closed.
    I have found that caching can be switched off via the SQLJ translator command line option -P-Cstmtcache=0.
    How can I specify this command line option within my JDeveloper project settings? I don't want to have to build my project from the command line explicitly as this will complicate the Release Software Build procedure.
    Can anyone help me, please?
    Thanks a lot.

    Can anyone offer any words of wisdom on this? We are currently using JDeveloper 3.1 (Build 681)

  • Licensing issues - embedding SQLJ translator

    I would like to find out what it would cost to license the SQLJ translator for embedding it my company's product. Can you tell me who I might need to contact to find this out?
    - Uhyon

    There's actually two issues here that need attention. If you're just outputting to default DPS folios then the pages become for all intents and purposes images so there's no real font-related issues. The more difficult area is if you're embedding your own html files that use Adobe fonts. I'd imagine things get more coplicated here.

  • SQLJ translator connection failing

    hi, i am trying to verify the sqlj translator connection to the db using the TestInstallSQLJ.sqlj code. i am using jdk1.3/8.1.5+sqlj8.1.6SDK on win98 -> jdk1.2.1/8.1.5 on nt4, and modified the sqlj.properties file appropriately. when i execute sqlj on the Test file, it says it can't load the OracleDriver:
    TestInstallSQLJ.sqlj:40.4-40.29: Warning: Cannot load JDBC driver class oracle.jdbc.driver.OracleDriver.
    TestInstallSQLJ.sqlj:40.4-40.29: Warning: Unable to perform semantic analysis on connection jdbc:oracle:thin:@<snip> by user <snip>. Error returned by database is: No suitable driver
    Total 2 warnings.
    Any help is appreciated.
    null

    You need to have the JDBC classes111.zip (for 1.1.x) or classes12.zip in your CLASSPATH environment variable. Say the following on the command line:
    javap oracle.jdbc.driver.OracleDriver
    - this should print out the methods on the OracleDriver class. Now say:
    sqlj -version-long
    This should print out all sorts of version information on SQLJ, JDBC and the JDK you are using. If yes, then you are in business. If it prints out the JDBC driver version as 0.0, then the Oracle JDBC driver is not yet in the CLASSPATH.

  • SQLJ Translator problem

    I get the following error message when trying to compile a SQLJ
    applet under Windows 95.
    I've previously managed to compile and run simple SQLJ programs
    successfully.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    unexpected error occurred...
    java.lang.NoClassDefFoundError:
    LDatabase;Lsqlj/runtime/profile/RTResultSet;)V
    at java.lang.Class.getDeclaredConstructors(Compiled Code)
    at
    sqlj.framework.JSClass$ClassWrapper.getDeclaredConstructors
    (Compiled Code)
    at
    sqlj.framework.JSClass.getMaximallySpecificConstructors(Compiled
    Code)
    at sqlj.framework.JSClass.resolveConstructor
    (JSClass.java:1136)
    at sqlj.codegen.IteratorMetaData.getBaseIterator
    (IteratorMetaData.java:75)
    at sqlj.codegen.IteratorMetaData.<init>
    (IteratorMetaData.java:63)
    at sqlj.codegen.ExecCodegen.addResultTypes(Compiled Code)
    at sqlj.codegen.ExecCodegen.getExecStmt
    (ExecCodegen.java:336)
    at sqlj.codegen.ExecCodegen.createExecStmt
    (ExecCodegen.java:128)
    at sqlj.codegen.ExecCodegen.createGenerator
    (ExecCodegen.java:63)
    at sqlj.codegen.ExecCodegen.generate
    (ExecCodegen.java:560)
    at sqlj.codegen.BaseCodegen.generate(BaseCodegen.java:28)
    at sqlj.codegen.ParseletFactory$ParseletImpl.generate
    (ParseletFactory.java:115)
    at sqlj.syntax.SqljParselet.generate
    (SqljParselet.java:128)
    at
    sqlj.javac.JavaParserSubTokenManager$PositionedParselet.generate
    (JavaParserSubTokenManager.java:171)
    at
    sqlj.javac.JavaParserSubTokenManager$TokenManagerParselet.generat
    e(Compiled Code)
    at sqlj.javac.ASTCompilationUnit.generate(Compiled Code)
    at sqlj.translator.Translator.translate(Compiled Code)
    at sqlj.translator.Translator.translate
    (Translator.java:170)
    at sqlj.translator.Main.translate(Compiled Code)
    at sqlj.translator.Main.runTranslation(Main.java:92)
    at sqlj.translator.Main.runTranslation(Main.java:85)
    at sqlj.tools.Sqlj.statusMain(Compiled Code)
    at sqlj.tools.Sqlj.main(Sqlj.java:117)
    Database.sqlj: Error: Exception caught:
    Total 1 error.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>
    The applet code is listed below
    >>>>>>>>>>>>>>>>>>>>>>>>>>>
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.sql.*;
    import sqlj.runtime.*;
    import sqlj.runtime.ref.*;
    import sqlj.runtime.profile.*;
    import oracle.sqlj.runtime.*;
    #sql context MyContext;
    #sql iterator SalesIter( String ITEM_NAME, float COST );
    public class Database extends Applet {
    String buffer = new String ();
    public void init()
    { MyContext mctx = new MyContext
    ("jdbc:oracle:thin@ntastlab:1521:lab8","training","training",fals
    e);
    System.out.println ("Connected to the database");
    public void start()
    SalesIter siter = null;
    #sql siter = {SELECT ITEM_NAME, COST FROM SALES };
    while (siter.next())
    buffer = buffer + siter.ITEM_NAME() + siter.COST ();
    repaint ();
    siter.close ();
    public void stop()
    public void destroy()
    public void paint(Graphics g) {
    g.drawString(buffer, 50, 25);
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Any ideas ??
    null

    The problem occurs when SQLJ tries to determine the type
    of the iterator SalesIter which is in your source.
    But I do not know, what that problem actually is.
    What version of javac? of sqlj? (JDK 1.2 does not work
    before SQLJ 8.1.6 SDK-Beta).
    What is in your PATH/CLASSPATH?
    What happens when you put SalesIter in SalesIter.sqlj:
    #sql public iterator SalesIter (...);
    and add this to your SQLJ command line?
    Dominic Lawson (guest) wrote:
    : I get the following error message when trying to compile a SQLJ
    : applet under Windows 95.
    : I've previously managed to compile and run simple SQLJ programs
    : successfully.
    : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    : unexpected error occurred...
    : java.lang.NoClassDefFoundError:
    : LDatabase;Lsqlj/runtime/profile/RTResultSet;)V
    : at java.lang.Class.getDeclaredConstructors(Compiled Code)
    : at
    : sqlj.framework.JSClass$ClassWrapper.getDeclaredConstructors
    : (Compiled Code)
    : at
    sqlj.framework.JSClass.getMaximallySpecificConstructors(Compiled
    : Code)
    : at sqlj.framework.JSClass.resolveConstructor
    : (JSClass.java:1136)
    : at sqlj.codegen.IteratorMetaData.getBaseIterator
    : (IteratorMetaData.java:75)
    : at sqlj.codegen.IteratorMetaData.<init>
    : (IteratorMetaData.java:63)
    : at sqlj.codegen.ExecCodegen.addResultTypes(Compiled Code)
    : at sqlj.codegen.ExecCodegen.getExecStmt
    : (ExecCodegen.java:336)
    : at sqlj.codegen.ExecCodegen.createExecStmt
    : (ExecCodegen.java:128)
    : at sqlj.codegen.ExecCodegen.createGenerator
    : (ExecCodegen.java:63)
    : at sqlj.codegen.ExecCodegen.generate
    : (ExecCodegen.java:560)
    : at sqlj.codegen.BaseCodegen.generate(BaseCodegen.java:28)
    : at sqlj.codegen.ParseletFactory$ParseletImpl.generate
    : (ParseletFactory.java:115)
    : at sqlj.syntax.SqljParselet.generate
    : (SqljParselet.java:128)
    : at
    sqlj.javac.JavaParserSubTokenManager$PositionedParselet.generate
    : (JavaParserSubTokenManager.java:171)
    : at
    sqlj.javac.JavaParserSubTokenManager$TokenManagerParselet.generat
    : e(Compiled Code)
    : at sqlj.javac.ASTCompilationUnit.generate(Compiled Code)
    : at sqlj.translator.Translator.translate(Compiled Code)
    : at sqlj.translator.Translator.translate
    : (Translator.java:170)
    : at sqlj.translator.Main.translate(Compiled Code)
    : at sqlj.translator.Main.runTranslation(Main.java:92)
    : at sqlj.translator.Main.runTranslation(Main.java:85)
    : at sqlj.tools.Sqlj.statusMain(Compiled Code)
    : at sqlj.tools.Sqlj.main(Sqlj.java:117)
    : Database.sqlj: Error: Exception caught:
    : Total 1 error.
    : >>>>>>>>>>>>>>>>>>>>>>>>>>>
    : The applet code is listed below
    : >>>>>>>>>>>>>>>>>>>>>>>>>>>
    : import java.applet.Applet;
    : import java.awt.Graphics;
    : import java.sql.*;
    : import sqlj.runtime.*;
    : import sqlj.runtime.ref.*;
    : import sqlj.runtime.profile.*;
    : import oracle.sqlj.runtime.*;
    : #sql context MyContext;
    : #sql iterator SalesIter( String ITEM_NAME, float COST );
    : public class Database extends Applet {
    : String buffer = new String ();
    : public void init()
    : { MyContext mctx = new MyContext
    ("jdbc:oracle:thin@ntastlab:1521:lab8","training","training",fals
    : e);
    : System.out.println ("Connected to the database");
    : public void start()
    : SalesIter siter = null;
    : #sql siter = {SELECT ITEM_NAME, COST FROM SALES };
    : while (siter.next())
    : buffer = buffer + siter.ITEM_NAME() + siter.COST ();
    : repaint ();
    : siter.close ();
    : public void stop()
    : public void destroy()
    : public void paint(Graphics g) {
    : g.drawString(buffer, 50, 25);
    : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    : Any ideas ??
    null

  • SQLJ Translator NullPointerException

    Hi there folks,
    I'm using the SQLJ and the Java Dictionary for the persistence layer in an application running on the Web AS 6.40 (SP11). I'm also using NetWeaver Dev. Studio SP11.
    I have one particular .sqlj file, which returns the following non specific error when I'm saving it:
    "Save could not be completed.
    Reason: Errors during build"
    A click on the "Details" button reveals the following a little less non specific error:
    "java.lang.NullPointerException encountered while running com.sap.dictionary.tools.sqlj.translator.Translator."
    Anyone's got an idea on what is wrong, or where to find out what is wrong?
    Thanks in advance,
    Henrik, Invendium A/S

    Never mind folks, a code rewrite made the Translator accept the source (funny, because it used to accept it..).
    /Henrik

  • SQLJ translation on Win2K box

    Machine: Win2k 256MB on board and 40 gig harddrive
    Database: Oracle 8.1.6 with jDeveloper 3.1
    JDK: Sun 1.3.1
    When I try to translate an sqlj file I get the following warning message:
    Warning: You are using an Oracle JDBC Driver, but connecting to a non-Oracle database.
    The url is jdbc:oracle:thin:@localhost:1521:SID. This url works fine with straight ODBC on the same machine, but sqlj does not seem to like it.
    Any explanation of what is happening would be appreciated.
    null

    Do you know what version of SQLJ you are using?
    (Place the SQLJ runtime.zip/translator.zip and your Oracle JDBC driver classesXX.zip in your CLASSPATH and say:
    java sqlj.tools.Sqlj -version-long )
    My gues would be that the SQLJ version is older that your Oracle database and thus may not correctly recognize the Oracle database designation.
    Additionally, note that there are issues when translating with 8.1.7 or older SQLJ versions under JDK 1.3 - see:
    http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#usingjdk13

  • Unable to start SQLJ Translator

    I tried to test the SQLJ and JDBC setup. I modified the connect.properties file and made the appropriate changes so that it refers to my database. When trying to compile TestInstallCreateTable.java, I get errors saying that some classes are not imported. But I am able to create SALES table thru the SQL+. But when I enter sqlj TestInstallSQLJ.sqlj from the command prompt, I get an Unable to initialize threads:cannot find class java/lang/Thread error. I have the path(Oracle_Home\bin) and classpath(Oracle_Home\jdbc\lib\classes111.zip and Oracle_Home\sqlj\lib\translator.zip) set up. The JDK version is 1.1.8. Am I missing something? Please advice.
    Thanks in advance.

    Thank you for your timely help. After setting up %JAVA_HOME%\lib\classes.zip in classpath, I am able to compile the .sqlj file. But I am not able to run. I get a java.lang.NoClassDefFoundError:oracle.sqlj.runtime.Oracle. I am able to see this class in the database, under Java classes. Kindly advice. Thanks in advance.

  • Why is it so hard to deploy EJBs that contain SQLJ???

    The SQLJ translator creates _SJProfilex.ser files by default that
    contain the SQL statements the SQLJ file uses. When trying to
    use a SQLJ file for an EJB, I can't get it to deploy right--in
    fact I'm thrawted at every turn! (THIS SHOULD BE EASY!)
    1) .ser files aren't deployed by default. O.K., I added the .ser
    rule in the deployment file. No dice, still doesn't show up in
    the JAR file!
    2) Even if I force the .ser file to be in the JAR (by including
    it in the project), still no dice! After deployment, the .ser
    file doesn't make it to the server.
    3) O.K., there's a nice -ser2class option to SQLJ that turns it
    into a class file instead of a .ser file. But where to add that
    option? It's not in the SQLJ options of the project properties.
    I also tried an SQLJ_OPTIONS environment variable, and putting an
    sqlj.properties file in all the suggested places. Nothing works!
    The only way I've been able to get it to work is to manually JAR
    the .ser file, ftp it to the server, and run loadjava on it.
    THERE HAS GOT TO BE AN EASIER WAY! ...so much for one-click
    deployment.
    Please help!
    null

    Hi John,
    There is an issue with deploying SQLJ files in 8.1.5.
    The doc (help sytem ) gives more details on how to deploy them.
    Open Online Help system
    Double click on the Sample Applications book icon
    Double click on the "web Application for Oracle8i" book
    Open "Deploying the EJB's"
    On the right hand window you will find a topic
    "Deploying the SQLJ files used by the Rentals EJB"
    this should take you through the deployment of SQLJ files.
    regards
    raghu
    John K. Peterson (guest) wrote:
    : The SQLJ translator creates _SJProfilex.ser files by default
    that
    : contain the SQL statements the SQLJ file uses. When trying to
    : use a SQLJ file for an EJB, I can't get it to deploy right--in
    : fact I'm thrawted at every turn! (THIS SHOULD BE EASY!)
    : 1) .ser files aren't deployed by default. O.K., I added the
    .ser
    : rule in the deployment file. No dice, still doesn't show up in
    : the JAR file!
    : 2) Even if I force the .ser file to be in the JAR (by including
    : it in the project), still no dice! After deployment, the .ser
    : file doesn't make it to the server.
    : 3) O.K., there's a nice -ser2class option to SQLJ that turns it
    : into a class file instead of a .ser file. But where to add
    that
    : option? It's not in the SQLJ options of the project
    properties.
    : I also tried an SQLJ_OPTIONS environment variable, and putting
    an
    : sqlj.properties file in all the suggested places. Nothing
    works!
    : The only way I've been able to get it to work is to manually
    JAR
    : the .ser file, ftp it to the server, and run loadjava on it.
    : THERE HAS GOT TO BE AN EASIER WAY! ...so much for one-click
    : deployment.
    : Please help!
    null

  • SQLJ connection exception in oracle 8i and jdk 1.5

    This is the code through which i am trying to extract current date from oracle database and print Helloworld
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orcl",
    "student",
    "student"
    // get the current date from the database
    #sql { SELECT sysdate INTO :current_date FROM dual };
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    this is the error
    unexpected error occurred...
    java.lang.ExceptionInInitializerError
         at sqlj.translator.Translator.addUnit(Translator.java:117)
         at sqlj.translator.Main.translate(Main.java:112)
         at sqlj.translator.Main.runTranslation(Main.java:92)
         at sqlj.translator.Main.runTranslation(Main.java:85)
         at sqlj.tools.Sqlj.statusMain(Sqlj.java:280)
         at sqlj.tools.Sqlj.main(Sqlj.java:125)
    Caused by: java.lang.NullPointerException
         at sqlj.framework.ClassFileReader.attribute_info(ClassFileReader.java:326)
         at sqlj.framework.ClassFileReader.readClass(ClassFileReader.java:224)
         at sqlj.framework.ClassFileReader.describeClass(ClassFileReader.java:62)
         at sqlj.framework.ClassFileReader.getDeclaringClass(ClassFileReader.java:146)
         at sqlj.framework.JSClass$ClassWrapper.getDeclaringClass(JSClass.java:1649)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1496)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1545)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1552)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1507)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1518)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1533)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1545)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1552)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1507)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1545)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1552)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1507)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1518)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1533)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveIfNonNull(JSClass.java:1513)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1493)
         at sqlj.framework.JSClass.resolveIfNonNull(JSClass.java:1513)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1493)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1534)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1545)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1552)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1507)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1518)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1533)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveIfNonNull(JSClass.java:1513)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1493)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1545)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1552)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1507)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1518)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1494)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1518)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1533)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1518)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1533)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1534)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveIfNonNull(JSClass.java:1513)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1495)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1534)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1518)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1494)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1534)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1539)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1508)
         at sqlj.framework.JSClass.resolveIfNonNull(JSClass.java:1513)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1493)
         at sqlj.framework.JSClass.resolveIfNonNull(JSClass.java:1513)
         at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1493)
         at sqlj.framework.JSClass.reflectSystemClass(JSClass.java:1340)
         at sqlj.framework.JSClass.<clinit>(JSClass.java:49)
         ... 6 more
    HelloWorld.sqlj: Error: Exception caught:
    Total 1 error.

    SQLJ 8i with jdk1.5?
    Please try SQLJ 10.2 with jdk1.4.

  • Java 1.5 and SQLJ Compiler -- Can't get Java 1.5 specific syntax to compile

    I am looking to upgrade our java version from Java 1.4 to Java 1.5. Once I upgrade I expect to be able to use Java 1.5 specific language constructs such as generics, annotations, the new for loop and such. In doing some reading (http://download.oracle.com/docs/cd/B28359_01/java.111/b31227/whatsnew.htm) it states that in the 11g release that sqlj could handle the new syntax. I have done my best to locate the new jar files for oracle 11.g to allow me to do the sqlj translation with java 1.5 syntax but even after locating all the latest jar files it still doesn't work.
    I downloaded the translator.jar and the latest oracle drivers from this link (http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html). It seems to me that the latest translator.jar file that I can get is only for 10g.
    Here is an example piece of code that I am trying to translate.
    public class TryIt
    public TryId() {}
    public static void main( String[] args )
    for ( String arg : args ) {
    System.out.println(arg);
    }

    You think it is normal that it takes 30 seconds to load.
    I think it is a programming problem. You should not import a lot of package.
    Applet are supposed to be light, it is not like programs it is normal when you're on 56k (of course aol steals some of those bandwidth by sending you advertisement) and it's not my applet..it's one of a few applet s that i encountered when surfing the web..so i have ano control over how it is implemented or designed. Even small one that do simple stuff like display a hello world takes forever to load.

  • Using SQLJ in Session EJB  (WebLogic 6.1) - connection giving ClassCastError

    Hi All
    I have one SQLJ file which i have translated to a .java file and , its contents ( methods) have ben pasted in a Session bean , which is deployed in Weblogic 6.1 App Server .
    Now in Session bean i am using the jndi lookup of my datasource in Weblogic and creating a conection to the database .
    with this connection the normal jdbc methods connects to the databse , but the sqlj method gives a class cast error when i try to allocate the Connection Object to the DefaultContext .
    *********************** CODE SNIP ********************
    new sqlj.runtime.ref.DefaultContext m_dx = new sqlj.runtime.ref.DefaultContext(conn);
    sqlj.runtime.ref.DefaultContext.setDefaultContext(m_dx);
    "conn"is the jndi dsn's
    DataSourse.getConnection ();
    /*In the Method */
    sqlj.runtime.ConnectionContext __sJT_connCtx = sqlj.runtime.ref.DefaultContext.getDefaultContext();
    the bean compiles , and is deployed sucessfully , and after lookup the conn and m_dx objects are created sucessfully , but when the sqlj method runs it gives a class cast exception .
    java.lang.ClassCastException: weblogic.jdbc.rmi.SerialConnection
    Is it that Weblogic will not support SQLJ translated code ?
    Please help me out , Will i be able to use the Good features of SQLJ in my EJB beans to be Deployed in Weblogic 6.1 Application Server .
    Thanks

    Hi Nicolas,
    Have you tried to turn on testOnReserve setting of the coneection pool?
    Regards,
    "Nicolas Devos" <[email protected]> wrote in message
    news:3c5fa916$[email protected]..
    >
    Hi,
    I am using weblogic 6.1 and oracle 8.1.6, and experiences
    problems with connections pools and database crash.
    When the database server crashes during an EJB transactions,
    the connection used by that transaction seems to be lost and
    is never rebuilt when the database server restarts, therefore
    the number of connections within the pool shrinks thoroughly
    if I have several connections used while the database crashes
    or is shutdown for maintenance.
    If this db crash takes time to recover, all connections
    are destroyed and the pool become unusable.
    As soon as all connections have been 'destroyed' I have
    the following exception:
    'connection pool - none available' when trying to get
    a connection.
    When I restart the database server, the pool does not rebuilt
    itself.
    (I am using a test table to test the presence of the database
    with a frequency set to 60s)
    I did the same operation without EJB transactions and the pool
    could rebuilt itself after the database has been restarted.
    I had that problem with weblogic 6.0 already and in the
    release notes of 6.0_sp2, 2 issues are fixed concerning
    the pool fail-over: 044223 and 041793.
    I would like to know if these issues are fixed in 6.1 as well,
    and if they are related to my problem (Their description is
    quite short).
    Thank you
    Nicolas

Maybe you are looking for

  • Upgrade to iphone 5 and keep unlimited data from an old blackberry?

    To Whom this may concern, I currently have a family plan with 5 lines (1 basic phone, 2 iphone 4s, and 1 blackberry bold). Both iphone 4s phones have 2gb of Internet data a month and the blackberry has unlimited internet data. I have 2 upgrades on my

  • Script no longer working under Maverick

    I just upgraded to Maverick over the weekend and I can not figure out why this script no longer works.  It has been working for the last 5 years. The script moves a file my server sends per e-mail to a folder on a partition on my Mac.  Here is the sc

  • Issue with Receiving ALL Types of Messages

    In the last few weeks I have noticed that SMS, MMS, BBM and e-mail messages have been reaching my BlackBerry Curve on a delayed basis.  Many times I only receive an SMS when I go to actually send one.  It's almost like these are backed up waiting for

  • Color correcting for a TV

    I want to display photos shot as JPG from a DSLR on a TV. When played on the TV they seem dark and lots of detail gets lost. Can anyone provide some general advice to make my images look good on a LCD TV? I am pretty new to Photoshop, would I just pl

  • Networking OS9 and OSX

    I have an old PM6400 running OS9 (upgrade card to a G3-400) and a PM G4 Dual 1 gig running 10.4.8 connected via airport (ethernet port on G4 using a DSL modem), base station connected to the ethernet port on the PM6400, airport card in the G4. I can