SQLJ Error
I am trying to write the following prog to display the detail of
the table
prod (pname varchar2(20), price number(10)),using Positional
Iterator. but
couldnt write a simple program . here is the code, as I compile
the code it
says
testpos.sqslj:45.2-45.44: Error: Invalid cursor type un FETCH
statement:MyIter.
I am new to JAVA, I am not able to fix the error. Please help me
out.
import java.sql.*;
import oracle.sqlj.runtime.*;
// iterator for the select
#sql iterator MyIter (String pname, int price);
class testpos
//Main method
public static void main (String args[])
try {
// set the default connection to the URL, user, and password
// specified in your connect.properties file
Oracle.connect(testpos.class, "connect.properties");
testpos ti = new testpos();
ti.runExample();
//end of try
catch (SQLException e)
System.err.println("Error running the example: " + e);
} //End of method main
//Method that runs the example
void runExample() throws SQLException
String prodname= null;
int pprice=0;
MyIter prods;
#sql prods = {SELECT pname, price FROM prod};
while (true)
#sql {FETCH :prods INTO :prodname, :pprice};
if (prods.endFetch()) break;
System.out.println("Name: " +prodname);
System.out.println("Price: " +pprice);
prods.close();
import java.sql.*;
import oracle.sqlj.runtime.*;
// iterator for the select
#sql iterator MyIter (String pname, int price);
class testpos
//Main method
public static void main (String args[])
try {
// set the default connection to the URL, user, and password
// specified in your connect.properties file
Oracle.connect(testpos.class, "connect.properties");
testpos ti = new testpos();
ti.runExample();
//end of try
catch (SQLException e)
System.err.println("Error running the example: " + e);
} //End of method main
//Method that runs the example
void runExample() throws SQLException
String prodname= null;
int pprice=0;
MyIter prods;
#sql prods = {SELECT pname, price FROM prod};
while (true)
#sql {FETCH :prods INTO :prodname, :pprice};
if (prods.endFetch()) break;
System.out.println("Name: " +prodname);
System.out.println("Price: " +pprice);
prods.close();
null
When declaring a positional iterator, only the datatype of each
column should be declared; the column names are not defined.
Change it to the following:
#sql iterator MyIter (String, int);
And it should work. I tested it.
Thanks,
Anand
null
Similar Messages
-
Hi,
I am new to SQLJ. Now, in my PC (with Win98), I have JDK 1.2 and Oracle 8i (personal edition). I have used Java and Oracle in my PC without any problem. Now, I am going to learn SQLJ in order to create a java program to access Oracle database. What I have done is to set up several classpaths in DOS:
SET classpath=C:\ora_program\sqlj\lib\translator.zip;
SET classpath=C:\ora_program\sqlj\lib\runtime.zip;
SET classpath=C:\ora_program\sqlj\lib\runtime12.zip;
SET classpath=C:\ora_program\jdbc\lib\classes12.zip;
The code of my program is:
import java.sql.Date;
import java.sql.SQLException;
import oracle.sqlj.runtime.Oracle;
import java.util.Date;
public class Hello{
public static void main(String[] args){
java.sql.Date current_date;
try{
// connect to the db
Oracle.connect(
"C:\ora_program\bin",
"system",
"manager");
// get the current date from the database
#sql{SELECT sysdate INTO :current_date FROM dual};
// display message
System.out.println("Hello, the current date is: "+ current_date);
catch(SQLException e){
System.err.println("sqlException: "+e);
finally{
try{
Oracle.close();
catch(SQLException e){
System.err.println("sqlException: "+e);
And then I compile my program in DOS with the typing: sqlj Hello.sqlj
The program cannot be compiled and the error message is:
"Exception in thread main java.lang.NoClassDefFoundError: sqlj/tools/Sqlj"
It indicates that the SQLJ translator class files cannot be found.
I have set up the classpath in DOS (see above). How does the error come? Please help. Thanks.
PC>
SET classpath=C:\ora_program\sqlj\lib\translator.zip;
SET classpath=C:\ora_program\sqlj\lib\runtime.zip;
SET classpath=C:\ora_program\sqlj\lib\runtime12.zip;
SET classpath=C:\ora_program\jdbc\lib\classes12.zip;
The above only sets the classpath to the last value. You need to use the following.
SET classpath=%classpath%;C:\ora_program\sqlj\lib\runtime.zip; -
SQLJ error in stored procedure
Okay I'm kind of new to this stuff so this is probably an easy
question but I can't fix my current problem. Know I have been
creating and compiling several java stored procedures in my
oracle 8.1.7.0.0 enterprise edition database. So far everything
is create I have created about a dozen and done all of their
call specs and everything works without a hitch.
The problem I have came into being when I tried to create a
stored procedure that uses SQLJ. When I create my stored
procedures I compile my java code straight into the database
using the
CREATE OR REPLACE AND COMPILE JAVA SOURCE named "myClass" AS
source
this has always worked from me except when I place my
#sql ; lines at which point it issues a the following error
SP2-7034 : unknown command beginning
at which point is it ignores the line of code and continues to
compile my java source. Does this mean the SQLJ is not enabled
in my database or what? I have checked out the SQLJ developer’s
hand book and it did not help me with this problem. Oh please
wont some wise oracle god help me!user21354 wrote:
i am creating the collection in my Stored procedure it is giving me this error
declare
type t_number is table of number;
v_numbers t_number;
begin
select VISIT_ID
bulk collect into v_numbers
from visit
where VISITTYPEID = 2;
select VISIT_ID from v_numbers;
end;
error
PL/SQL: ORA-00942: table or view does not exist
please tell me this why this happeningcouple of things...
context switching - Your second 'select visit_id' query is actually parsed outside plsql, in the 'sql engine'. This sql engine has no knowledge of what v_numbers is, it's expecting an actual table name but it can't find anything called v_numbers in it's metadata. So it bombs out with that error. Google 'context switching plsql' for more info. :o)
- as v_numbers is a collection, you could just loop through the results:
for n in 1..v_numbers.count
loop
dbms_output.put_line(v_numbers(n));
end loop;- as stated above, a 'select' without 'into' won't work in plsql anyway.
- there is a way of getting round the context switch, by creating your Type in sql rather than plsql and 'casting' it to a table. Let us know if you want to know the steps to do it, but try reading up on context switch first.
cheers. -
Advanced queueing hotel example (sqlj error)
can anyone help me about why this error occured when i follow all the steps of installation.
when i exec the command ->sqlj -status -ser2class HotelSystemSLJ.sqlj HotelSQLJ.sqlj *.java
this error occured. i use oracle 9i and my translator.zip file is copied from {9i home}/sqlj/lib
but in my classpath both of the translator.zip file is defined. one is at 9i home and the other is at oc4j home. when i defined the only oc4j home file the command returned the error that it cant find the sqlj translator so i defined both in my classpath
D:\oracle9ias\core\J2EE_containers\j2ee\home\applications\AQEJBHotelSample\src\
ava\oracle\otnsamples\AQEJBHotelSample\ejb>sqlj -status -ser2class HotelSystemS
LJ.sqlj HotelSQLJ.sqlj *.java
[Translating 15 files]
[Reading file HotelSystemSQLJ]
[Reading file HotelSQLJ]
[Reading file AQHotelMessage]
[Reading file Hotel]
[Reading file HotelBean]
[Reading file HotelDetails]
[Reading file HotelHome]
[Reading file HotelSummary]
[Reading file HotelSystem]
[Reading file HotelSystemBean]
[Reading file HotelSystemHome]
[Reading file RequestAQHandler]
[Reading file ReservationDetails]
[Reading file RoomType]
[Reading file ServiceAQHandler]
[Translating file HotelSystemSQLJ]
[Translating file HotelSQLJ]
[Translating file AQHotelMessage]
[Translating file Hotel]
[Translating file HotelBean]
[Translating file HotelDetails]
[Translating file HotelHome]
[Translating file HotelSummary]
[Translating file HotelSystem]
[Translating file HotelSystemBean]
[Translating file HotelSystemHome]
[Translating file RequestAQHandler]
[Translating file ReservationDetails]
[Translating file RoomType]
[Translating file ServiceAQHandler]
[Compiling 15 Java files]
java.io.IOException: CreateProcess: javac -J-Djavac.pipe.output=true HotelSyste
SQLJ.java HotelSQLJ.java AQHotelMessage.java Hotel.java HotelBean.java HotelDet
ils.java HotelHome.java HotelSummary.java HotelSystem.java HotelSystemBean.java
HotelSystemHome.java RequestAQHandler.java ReservationDetails.java RoomType.jav
ServiceAQHandler.java error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at sqlj.tools.Sqlj.runCompilation(Sqlj.java:910)
at sqlj.tools.Sqlj.statusMain(Sqlj.java:384)
at sqlj.tools.Sqlj.main(Sqlj.java:140)
Error in Java compilation: CreateProcess: javac -J-Djavac.pipe.output=true Hote
SystemSQLJ.java HotelSQLJ.java AQHotelMessage.java Hotel.java HotelBean.java Ho
elDetails.java HotelHome.java HotelSummary.java HotelSystem.java HotelSystemBea
.java HotelSystemHome.java RequestAQHandler.java ReservationDetails.java RoomTy
e.java ServiceAQHandler.java error=2Coskan,
Sorry for annoying you...Since i cudnt
reprodue the same error here in my machine, please provide
following details also....
1. Have you set the classpath environment variable correctly?
Means all the jar files (Jndi.jar,ejb.jar,jta.jar,aqapi.jar,tools.jar, classes12.jar)are
in classpath?
2. Have you put <Oracle9i_Home>/bin in your classpath???
Since sqlj.exe is in <Oracle9i_Home>/bin, this step is mandatory...
Cheers
--Venky -
Error: Unsupported Java type for item #1 of INTO-list: java.sql.Blob.
What be the fix?
tia,
[email protected]Error: Unsupported Java type for item #1 of INTO-list: java.sql.Blob.
What be the fix?
tia,
[email protected] -
BUG: error rebuilding SQLJ files along other java files with generic
I have done a rebuild on a package containing some SQLJ files, and (consistently) got the following error:
C:\TeleMessage\trunk\src\telemessage\db\impl\dbAdmin.sqlj
Error(44,18): Java Parsing. Encountered: <
Expected: <IDENTIFIER> ...; "[" ...; The error at the cursor in the given file is not possible, since there was no '<' there, and besides - if I non-aggresively changed the file, e.g. narrowed imports, changed whitespace or added comments - the error remained in the same location.
I went and done a search using regex in the package, for a line starting with 17 chars followed by a '<'.
I found it in one of the normal JAVA files (not-SQLJ), at line 44 (surprise!) - in a Java 5 generics declaration, e.g. Map<String,Integer>. the 18th character was indeed the '<'.
I'm guessing that the SQLJ translator (accidentally?) parses non-SQLJ files.
If this cannot be fixed, it is really bad - it is one thing that JDeveloper cannot support Java 5 language features because of its dependancy in the SQLJ translator (which is not known to be upgraded until version 11g if at all), but the inability to compile SQLJ files in a project containing other non-SQLJ java files with Java 5 features is hard.
I could only workaround this by rebuilding SQLJ files one at a time!
I also have another type of error, when rebuilding the same project in a higher-level pacakge (root or "Application Sources"):
C:\TeleMessage\trunk\src\dbtools\CallbackNumberFiller.sqlj
Error(24,8): Missing semicolon.
Error(24,8): Unbalanced curly braces.Again, the specified file could not be the one to blame - the location of the error is in the middle of the public modified keyword in a method declaration; nothing is neither missing nor unbalanced.
This appears to be different, as it pops in the log near the end of the build process, when the JSPs are being built, specfically during the time the message log fills with "writing <...>" lines (after "translating <...>" and "compiling <...>".
I can consistently reproduce both cases - please advise how I can help you find out what causes this.
Regards,
Yaniv KundaFirst of all, this bug not JDeveloper's problem, but the SQLJ team's.
You can read more posts about this:
Re: BUG: Cannot translate SQLJ files with Java5 generics code
Re: How to use SQLJ with Java 1.4 and 1.5?
Re: SQLJ discontinued??
And if we're at it, this is strange - I can't seem to find the oracle doc you quoted...
SQLJ 11g? The latest release is a part of JPublisher 10.2 available from
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
I also didn't find anything on google on 11g, nor about the part number you specified.
Didn't find any Java 1.5 supporting SQLJ translators from other vendors as well.
Do you have any link to this statement?
But if we examine this bug again, the problem involves JDeveloper passing Java 5 featured JAVA files to the SQLJ translator.
Isn't there a way to instruct the translator to use CLASS files compiled by a normal Java 5 compiler, instead of trying to compile the files itself?
Regards,
Yaniv Kunda -
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. -
Sqlj.runtime package missing
Two questions:
1) JDeveloper 3.1 is not able to locate sqlj.runtime and it's there, it was working properly a 15 minutes ago. Any suggestion?
2) what does the following warning message mean?
Warning: (33) Type driverTest.Driver of host item #1 is not permitted in JDBC. This will not be portable..
Thanks in advance!!
The whole error message I got from JDev:
D:\Program Files\Oracle\JDeveloper 3.1\myprojects\driverTest\mydriver.sqlj
Warning: (33) Type driverTest.Driver of host item #1 is not permitted in JDBC. This will not be portable..
Error: (4) identifier sqlj.runtime.ref.DefaultContext not found.
Error: (5) identifier sqlj.runtime.ConnectionContext not found.
Error: (20) class ConnectionContext not found in class driverTest.mydriver.
Error: (11) identifier sqlj.runtime.ref.ConnectionContextImpl not found.
Error: (11) identifier sqlj.runtime.ConnectionContext not found.
Error: (0) identifier sqlj.runtime.profile.Loader not found.
Error: (17) variable DefaultContext not found in class driverTest.mydriver.
Error: (17) constructor mydriver$_Ctx(<any>) not found in class driverTest.mydriver._Ctx.
Error: (22) constructor mydriver$_Ctx(<any>) not found in class driverTest.mydriver._Ctx.
Error: (26) constructor mydriver$_Ctx(java.sql.Connection) not found in class driverTest.mydriver._Ctx.
Error: (33) identifier sqlj.runtime.ConnectionContext not found.
Error: (33) identifier sqlj.runtime.error.RuntimeRefErrors not found.
Error: (33) identifier sqlj.runtime.ExecutionContext not found.
Error: (33) identifier sqlj.runtime.error.RuntimeRefErrors not found.
Error: (33) identifier sqlj.runtime.profile.RTStatement not found.
Error: (0) identifier sqlj.runtime.RuntimeContext not found.
Error: (0) method getProfileKey(<any>, java.lang.String) not found in class driverTest.mydriver._Ctx.
D:\Program Files\Oracle\JDeveloper 3.1\myprojects\driverTest\Driver.sqlj
Error: (11) identifier sqlj.runtime.ref.DefaultContext not found.
Error: (12) identifier sqlj.runtime.ConnectionContext not found.
Error: (52) class ConnectionContext not found in class driverTest.Driver.
Error: (20) identifier sqlj.runtime.ref.ConnectionContextImpl not found.
Error: (20) identifier sqlj.runtime.ConnectionContext not found.
Error: (44) variable DefaultContext not found in class driverTest.Driver.
Error: (44) constructor Driver$_Ctx(<any>) not found in class driverTest.Driver._Ctx.
Error: (55) variable DefaultContext not found in class driverTest.Driver.
Error: (55) constructor Driver$_Ctx(<any>) not found in class driverTest.Driver._Ctx.
Error: (61) constructor Driver$_Ctx(java.sql.Connection) not found in class driverTest.Driver._Ctx.
Error: (67) constructor Driver$_Ctx(oracle.jdbc.driver.OracleConnection) not found in class driverTest.Driver._Ctx.
Error: (77) constructor Driver$_Ctx(oracle.jdbc.driver.OracleConnection) not found in class driverTest.Driver._Ctx.
D:\Program Files\Oracle\JDeveloper 3.1\myhtml\driverTest_html\view.jsp
Error: (27) incompatible types; found: void, required: driverTest.Driver.
null1) JDeveloper 3.1 is not able to locate sqlj.runtime Ensure that the SQLJ runtime.zip and/or translator.zip file is in the project's CLASSPATH.
2) Warning: (33) Type driverTest.Driver of host item #1 is not permitted in JDBC. This warning is issued if you use Java types that are supported by Oracle's JDBC driver (and thus in the Oracle SQLJ runtime), but that are not JDBC types. You'd only care about this warning if you want to write fully portable code. You can turn of portability warnings in JDeveloper under project properties on the SQLJ tab. On the SQLJ command line you could say: -warn=noportable. -
Error while compiling TestInstallSQLJ
dear all,
i don't konw why the translator produced the follwoing errors when i tried to translate the example TestInstallSQLJ.sqlj:
java.lang.ExceptionInInitializerError: java.lang.NullPointerException
at sqlj.framework.ClassFileReader.attribute_info(Compiled Code)
at sqlj.framework.ClassFileReader.readClass(Compiled Code)
at sqlj.framework.ClassFileReader.describeClass(Compiled Code)
at sqlj.framework.ClassFileReader.getDeclaringClass(Compiled Code)
at sqlj.framework.JSClass$ClassWrapper.getDeclaringClass(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1542)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveIfNonNull(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveIfNonNull(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1542)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1504)
at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1531)
at sqlj.framework.JSClass.resolveClassReferences(Compiled Code)
at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1505)
at sqlj.framework.JSClass.resolveIfNonNull(JSClass.java:1510)
at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1490)
at sqlj.framework.JSClass.resolveIfNonNull(JSClass.java:1510)
at sqlj.framework.JSClass.resolveClassReferences(JSClass.java:1490)
at sqlj.framework.JSClass.reflectSystemClass(JSClass.java:1340)
at <Unloaded Method>
at sqlj.javac.Token.getType(Token.java:288)
at sqlj.javac.LiteralNode.<init>(LiteralNode.java:17)
at sqlj.javac.StringLiteralNode.<init>(StringLiteralNode.java:14)
at sqlj.javac.JavaParserImpl.Literal(JavaParserImpl.java:3421)
at sqlj.javac.JavaParserImpl.PrimaryPrefix(JavaParserImpl.java:3288)
at sqlj.javac.JavaParserImpl.PrimaryExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.PostfixExpression(JavaParserImpl.java:3179)
at sqlj.javac.JavaParserImpl.UnaryExpressionNotPlusMinus(JavaParserImpl.java:3166)
at sqlj.javac.JavaParserImpl.UnaryExpression(JavaParserImpl.java:3099)
at sqlj.javac.JavaParserImpl.MultiplicativeExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.AdditiveExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.ShiftExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.RelationalExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.InstanceOfExpression(JavaParserImpl.java:2882)
at sqlj.javac.JavaParserImpl.EqualityExpression(Compiled Code)
at sqlj.javac .JavaParserImpl.AndExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.ExclusiveOrExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.InclusiveOrExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.ConditionalAndExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.ConditionalOrExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.ConditionalExpression(JavaParserImpl.java:2703)
at sqlj.javac.JavaParserImpl.Expression(JavaParserImpl.java:2622)
at sqlj.javac.JavaParserImpl.ArgumentList(Compiled Code)
at sqlj.javac.JavaParserImpl.Arguments(JavaParserImpl.java:3458)
at sqlj.javac.JavaParserImpl.PrimarySuffix(JavaParserImpl.java:3388)
at sqlj.javac.JavaParserImpl.PrimaryExpression(Compiled Code)
at sqlj.javac.JavaParserImpl.StatementExpression(JavaParserImpl.java:3993)
at sqlj.javac.JavaParserImpl.Statement(JavaParserImpl.java:3674)
at sqlj.javac.JavaParserImpl.BlockStatement(JavaParserImpl.java:3792)
at sqlj.javac.JavaParserImpl.Block(Compiled Code)
at sqlj.javac.JavaParserImpl.TryStatement(Compiled Code)
at sqlj.javac.JavaParserImpl.Statement(JavaParserImpl.java:3709)
at sqlj.javac.JavaParserImpl.BlockStatement(JavaParserImpl.java:3792)
at sqlj.javac.JavaParserImpl.Block(Compiled Code)
at sqlj.javac.JavaParserImpl.MethodDeclaration(Compiled Code)
at sqlj.javac.JavaParserImpl.ClassBodyDeclaration(JavaParserImpl.java:1370)
at sqlj.javac.JavaParserImpl.ClassBody(Compiled Code)
at sqlj.javac.JavaParserImpl.UnmodifiedClassDeclaration(Compiled Code)
at sqlj.javac.JavaParserImpl.ClassDeclaration(Compiled Code)
at sqlj.javac.JavaParserImpl.TypeDeclaration(JavaParserImpl.java:828)
at sqlj.javac.JavaParserImpl.CompilationUnit(Compiled Code)
at sqlj.javac.JavaParserSub.parseSQLJUnit(JavaParserSub.java:111)
at sqlj.translator.Translator.addUnit(Translator.java:124)
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)
TestInstallSQLJChecker.sqlj: Error: Exception caught:
Total 1 error.
thank you for your help
nullthank you for your reply.
I didn't install sqlj 8.1.5, i just downloaded the translator sqlj 8.0.5 and tried to run it. I don't know where to download sqlj 8.1.5 after long search on the Oracle website. Therefor after I updated
with the sqlj 8.1.6 sdk patch, sqlj -version still showed version 8.0.5
Actually i am using Oracle 8.0.5 database, Java 1.2.1 on a solaris. I use DRIVER=oracle.jdbc.driver.OracleDriver,
URL=jdbc:oracle:thinh:@localhost:1530:DBdata
PATH=usr/java/bin:/usr/local/stronghold/ssl/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/etc:/usr/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/usr/sbin:/usr/X11/bin:/usr/openwin/ bin:/opt/gnu/bin:/opt/hpnp/bin:/usr/lib/nis:/home/thinh/bin:.:/opt/SUNWspro/bin:/home/thinh//sqlj/sqlj/bin
CLASSPATH= very long classpath + /home/thinh/sqlj/sqlj/lib/translator.zip:/home/thinh/sqlj/sqlj/lib/runtime.zip
thank you very much for your help -
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 ??
nullThe 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 and "Unable to instrument
The file ProclaimAgent.sqlj uses a static (Singleton) class
called SpotCache contained in another package. The
class is referenced as a class field :
com.lenfest.radius.business.SpotCache spotcache = null;
and in the class constructor :
spotcache = com.lenfest.radius.business.SpotCache.getInstance();
and in method calls :
Spot spot = spotcache.getSpot(spotid);
The trouble is that sqlj errors out with the following:
"Unable to instrument SpotCache.class: SpotCache.class
No instrumentation: class already instrumented."
Now this is not a problem entirely, as it correctly produces
the class file. However, the error code returned
causes "make" to go abort the make.
What to do ?
nullHi, try this:
For the sake of security, recommendations say to have unique, complex passwords. Most people have a hard time remembering these and will eventually forget one. Forgetting the root password on a Mac system can seem devastating, but this recipe will show an easy way to recover.
If you have the password to an account that is an administrator on the system, then it is easy to recover the password using the sudo command. Open a terminal window and type:
sudo passwd root
and you will be prompted for your password (the user account that you do remember). Then you will be prompted for the new root password twice. That's it!
The sudo command is a wonderful way to control who can do what on a system. In this case, since the user account is considered an administrator, the sudo command allows you (after confirming that you are who you say you are with the user password) to run a command as if you were root. The command we are running is passwd root which is the command to change the password for the root user.
If you do not have an administrator password, either, you can still reset the root password. Boot the system from the Mac OS X installation CD and select the Reset password option from the installer screen and follow the directions. -
Error while calling a stored procedure using SQLJ
I am calling a stored procedure defined inside a package through a SQLJ script. The first parameter of that procedure is a IN OUT parameter which is used as a ROWID for creating a cursor. That ROWID value is the same for every record in the table, thereby enabling us to create a cursor.
When I give a hard-coded value as a parameter, I get an error stating that the assignment is not correct as the query is expecting a variable and not a literal. Hence I removed the hard-coded value and included a dymanic value in the SQLJ call.
String strVal = "A";
#sql{CALL ASSIGNMENTS_PKG.INSERT_ROW :{strVal},'SALARY_CODE_GROUP','BU',3,105,sysdate,1,sysdate,1,1)};
Here "ASSIGNMENTS_PKG" is a package name and INSERT_ROW is the procedure.
When the SQLJ program is run, I get an error stating:
"PLS-00201: identifier 'A' must be declared"
I read the error message, but I am not able to understand where I need to give the GRANT permission to.If you're using Oracle Provider for OLE DB (OraOLEDB) to execute this stored procedure, you need to set PLSQLRSet attribute. This attribute can be set in registry, connection string, or command object. Please refer to User Documentation for more information.
-
Error while running SQLJ program
I got the following error message when i execute a SQLJ program.
C:\Oracle\oracle8i\sqlj\demo>java TestInstallSQLJ
Error running the example: java.sql.SQLException: No suitable driver
Expecting help from anyone.
ThanksCould you post your sample program and what your classpath is? Most likely the oracle drivers are not in the classpath, or if running the oci driver, the shared libraries (or dlls) are not in your library path or (path).
-
Error when create a new SQLJ File
Hi
Any idea why I am getting the following error when I try to create SQLJ file?
Caught SQL Error: could not instantiate class: com.sap.dictionary.database.catalog.XmlCatalogReaderHi,
You are missing the jar file which is responsible for initializing the class. This is the base file for your catalog generation in SQLJ.Is this file missing from your "lib" folder of ur project structure?
Rdgs,
G -
Problems in Query, error handling and sqlj
I need some clarifications:
1. Can I use where clause in Insert query: for e.g: Insert into table_name (.., ...) values (.., ..) where id not in (Select Id from table_2 where name = '');
2. Can I handle error in my query in sqlj file. For e.g unique constraint violated error, I want to handle it like try-catch block in Java. So that if there would be any such error it will ignore.
3. I want to do this both in the sqlj file. Is it possible?
If anyone can answer it would be a great help for me.more appropriate forums :
PL/SQL
JDeveloper and ADF
SQL-Syntax and much more :
http://tahiti.oracle.com/
http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/toc.htm
http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_9014.htm#i2163698
http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_9014.htm#i2079995
http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_9014.htm#i2145081
Maybe you are looking for
-
How to delete all the PSA data in one go
Hello Guys, I want to clear all the data from all the PSA tables at one shot, how can i do this?? I have tried following things: 1) I have gone to PSA root node and right click and then clicked on delete PSA data, but its showing me all the datasourc
-
When I save an Illustrator file as a PDF, the stroke weights often look substantially heavier than the original when the document is viewed in Acrobat or Reader. It almost looks like all strokes less than 1pt. are displaying at 1pt no matter how smal
-
Can't print pdf files with adobe XI?
I can't print any pdf files since I updated to Adobe reader XI
-
Writing an A4 document to A4 pdf
Each time I try writing my A4 document to A4 pdf, I end up with Letter (8.5" x 11"). When I click ctrl + P, I choose Printer Properties and in the Adobe PDF Settings tab of the ADobe PDF Document Properties window, I am choosing A4 under Adobe PDF Pa
-
Third party tools to extend Webi graphic capabilities
All, Is any one aware or uses any good third party plug-ins to extend webi charts/graphic capabilities? We are looking for a plug-in that will help us extend webi charting or in general report formatting capabilities. Thank you in advance for your he