SQLJ Object Demo Oracle 8.1.6/7
Hi
I tried the object demo from ORA_HOME\sqlj\demo\Objects. The
result looks verry strange:
$ java ObjectDemo
*** SQLJ OBJECT DEMO ***
Selecting person attributes.
Selected person attributes:
name = Wolfgang Amadeus Mozart
ssn = 123456
address = Am Berg 100, Salzburg, AU, 10424
Updating person attributes..
Updated address attribute of person.
Selecting the Ludwig van Beethoven person object.
Person 0x4C75647769672076616E2042656574686F76656E, SSN=234567:
Street: '0x4E657720537472656574'
City: '0x4E65772043697479'
State: '0x5741'
Zip: '0x3533323431'
Inserted person object NEW PERSON.
Current office address of employee 1001:
Street: '0x353030204F7261636C65205061726B776179'
City: '0x526564776F6F642043697479'
State: '0x4341'
Zip: '0x3934303635'
UPDATE failed with java.sql.SQLException: Nicht unterst3tzter
Zeichensatz: oracl
e-character-set-10
Selecting manager of Ludwig van Beethoven via a REF.
Current manager of Ludwig van Beethoven:
Person 0x576F6C6667616E6720416D6164657573204D6F7A617274, SSN=123456:
Street: '0x416D204265726720313030'
City: '0x53616C7A62757267'
State: '0x4155'
Zip: '0x3130343234'
Updating manager REF.
Updated manager of employee 1001. Selecting back
Current manager of 1001:
Person 0x4E455720504552534F4E, SSN=987654:
Street: '0x4E455720535452454554'
City: '0x4E45572043495459'
State: '0x4E53'
Zip: '0x4E5A495020'
*** END OF SQLJ OBJECT DEMO ***
I tested the demon with jdk 1.3.1 and 1.2.2, Oracle client +
server 8.1.6 and 8.1.7 on windwos NT4.
Any idea?
Lars Tetzlaff
Well one way of doing this is to go into DBA studio for this database and set it up such that user A has the same privileges as user 'sa' which include select, insert, etc.
Similar Messages
-
ORA00932 inconsistent datatypes For member methods in SQLJ Object called from SQLPlus
Hi, I would very much appreciate advice on the following problem, its a tricky one, here are the full details....
A) EXECUTIVE SUMMARY....
I have created an oracle object type by wrapping a SQLData java object with the Oracle Create type statement. I am using Oracle 9i on NT4. However despite following the very few Oracle examples I could find, I get the following error....
select value(aaa).testint() from dealsobjtab aaa
ORA-00932: inconsistent datatypes
select value(aaa).testme() from dealsobjtab aaa
ORA-00932: inconsistent datatypesHere is what I've done...
1) Create Java object using SQLData interface (see listing below)
2) Load the Java source to Oracle 9i
3) Run the Oracle Create Type statement to wrap the java class
4) Use the objects in a table and successfully insert rows and query attributes using SQLPlus
5) Find I can't pull back data from any instance methods without getting an "inconsistant datatypes" error for both string and int datatypes. (see below for queries and output from SQLPlus)
B) STEP BY STEP DETAILS FOLLOW......
1) Java Source (in file \dealcalcs\Dealtest.java)
package dealcalcs;
import java.sql.SQLException;
import oracle.jdbc.OracleConnection;
import oracle.jdbc.OracleTypes;
import java.sql.*;
public class Dealtest implements SQLData
public static final String SQLNAME = "SWITCHBLADE_DATA.DEALTEST";
public static final int SQLTYPECODE = OracleTypes.STRUCT;
protected java.math.BigDecimal m_dealid;
protected java.sql.Timestamp m_startdate;
protected String m_dealtype;
protected Double m_facevalue;
/* constructor */
public Dealtest() { }
public void readSQL(SQLInput stream, String type)
throws SQLException
setDealid(stream.readBigDecimal());
setStartdate(stream.readTimestamp());
setDealtype(stream.readString());
setFacevalue(new Double(stream.readDouble()));
if (stream.wasNull()) setFacevalue(null);
public void writeSQL(SQLOutput stream)
throws SQLException
stream.writeBigDecimal(getDealid());
stream.writeTimestamp(getStartdate());
stream.writeString(getDealtype());
if (getFacevalue() == null)
stream.writeBigDecimal(null);
else
stream.writeDouble(getFacevalue().doubleValue());
public String getSQLTypeName() throws SQLException
return SQLNAME;
/* accessor methods */
public java.math.BigDecimal getDealid() { return m_dealid; }
public void setDealid(java.math.BigDecimal dealid) { m_dealid = dealid; }
public java.sql.Timestamp getStartdate() { return m_startdate; }
public void setStartdate(java.sql.Timestamp startdate) { m_startdate = startdate; }
public String getDealtype() { return m_dealtype; }
public void setDealtype(String dealtype) { m_dealtype = dealtype; }
public Double getFacevalue() { return m_facevalue; }
public void setFacevalue(Double facevalue) { m_facevalue = facevalue; }
//These last two are the member methods I call
public String testme(){
String tmp = new String("testme worked");
return tmp;
public int testint(){
int tmp = 0;
tmp = 88;
return tmp;
2, 3, 4) Here is how I wrap the uploaded SQLJ object, create a table using it, and put a row in it....
create or replace type deal_t as object
external name 'dealcalcs.Dealtest'
LANGUAGE JAVA USING SQLData (
DEALID NUMBER (11) external name 'dealid',
STARTDATE DATE external name 'startdate',
DEALTYPE VARCHAR2 (50) external name 'dealtype',
FACEVALUE FLOAT (49) external name 'facevalue',
MEMBER FUNCTION testme RETURN VARCHAR2
EXTERNAL NAME 'testme() return java.lang.String',
MEMBER FUNCTION testint RETURN NUMBER
EXTERNAL NAME 'testint() return int'
) not final
create table dealsobjtab of deal_t;
insert into dealsobjtab values ( deal_t(1, to_date('1/jan/1968'), 'NZD/NZD', 500))
COMMIT
5) Here I select attributes from the object table, and select using the two member methods, note that my member methods fail miserably, and advice on fixing this would be much appreciated....
select * from dealsobjtab aaa
DEALID STARTDATE DEALTYPE FACEVALUE
1 01/01/1968 NZD/NZD 500
1 row selected
select value(aaa).dealid from dealsobjtab aaa
VALUE(AAA).DEALID
1
1 row selected
select value(aaa).testint() from dealsobjtab aaa
ORA-00932: inconsistent datatypes
select value(aaa).testme() from dealsobjtab aaa
ORA-00932: inconsistent datatypes
Phew, that was a long email, I hope you are still awake after all that. I have no idea how to solve this, and would really appreciate some advice to get me going.
Yours Sincerely,
Michael CatoBut, i am receiving the error i have mentioned. is it depends on the java version also?
Please suggest.. -
How to recompile the objects in oracle apps
i used adadmin and compiled the apps schema .. but still i am getting INVALID objects .. how to compile these objects ?
Below is the output after running adadmin .. suggest
select owner,object_type,status from dba_objects where status='INVALID'
SQL> /
OWNER OBJECT_TYPE STATUS
FLOWS_010500 JAVA SOURCE INVALID
FLOWS_010500 JAVA CLASS INVALID
PUBLIC SYNONYM INVALID
PUBLIC SYNONYM INVALID
PUBLIC SYNONYM INVALID
PUBLIC SYNONYM INVALID
RE PACKAGE BODY INVALID
HERMAN TABLE INVALID
APPS PACKAGE BODY INVALID
APPS PACKAGE BODY INVALID
APPS PACKAGE BODY INVALID
OWNER OBJECT_TYPE STATUS
APPS PACKAGE BODY INVALID
APPS MATERIALIZED VIEW INVALID
CA TABLE INVALID
CA TABLE INVALID
Thanks in advancei have 12.1.1 instance on Linux OS
there is no adcompsc.pls file in $AD_TOP/sql .. i can see only adcompsc.sql You are on R12, and this script is no longer available -- See (Invalid Objects In Oracle Applications FAQs [ID 104457.1]), 10. How can I recompile all my invalid objects using ADCOMPSC.pls?
Below is the error when i try to run the adcompsc.pls file .. please help
[oaebiz@oracle sql]$ sqlplus @adcompsc.pls apps apps %
SQL*Plus: Release 10.1.0.5.0 - Production on Tue Jan 4 08:36:03 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SP2-0310: unable to open file "adcompsc.pls"
Enter User-name :Use adcompsc.sql instead.
Thanks,
Hussein -
Dropping java object from Oracle 8i
We areaable to load java methods and publish them to SQL in Oracle 8i using Jdev Deploy wizard, but we can not drop them thru
Open View As->Database Browser of the connection object, they drop menu is greyed out/disable. What kind privilege we need to drop java object from Oracle 8i? Or there is something wrong with the database setup.
Thank you very muchThere are three options:
Normal
SysDBA
SysOper
I have tried the three of them, none of them works, is there third option SYS?
Thank you very much.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Amit:
Log in as SYS.<HR></BLOCKQUOTE>
null -
How to store java object in oracle
Hi all,
is it possible to store jva object in oracle.
I have defined myClass. It have only data fields ( no methods).
I make myClass myObject = new myClass();
How can I store this object in oracle DB.
Many thanks in advance.1.Convert this object into stream of Bytes.
2.create a new InputStream from these Byte array.
2.Use the setBinaryStream to set the values inside the table's column.
3.Store this object as a Blob in the table (column type must be Blob).
Hope this helps.
Sudha
PS:- Somebody explained in this forum how to convert an Object into Byte array . -
Hai all,
I want to know where could I get good material on using Objects in Oracle (in Forms) plus some good tutorial regarding the same.
Thanx
Vinayakit it necessary to use adadmin to compile these objects and whether to use this with Maintenance Mode.No it is not necessary to use adadmin but recommended and you do not need to enable maintenance mode before compiling invalids irrespective of using adadmin or utlrp or adcomps.pls
I was previously using urlrp.sql/etc to recompile invalid objects with non-APPS environment, so what is the difference in these 2. here also you can use utlrp.sql but ideally we use utlrp.sql when no one is connected to system but adadmin can be used while users are in. Also through adadmin you can compile invalid of apps schema only and utlrp will compile all invalids in db.
adadmin calls $AD_TOP/sql/adcompsc.sql for compiling invalids. You can read this sql to view its functioning.
what could be the issues, if i run manual recompile on running APPS environment or by using Oracle EM to compile APPS/etc Scheama.You can do it manually, no issues.
Thanks,
JD -
Data objects and code objects in oracle application
Hi,
can any one please help me out with following question?
1. what are data objects and code objects in oracle apps and why is that difference?
2. How does the objects gets created in Oracle Applications, like during the installation which part is responsible for creating objects and after the installtion later point of time, how the new objects gets created in oracle applications?
3. what are the ways to find out if my 11i application is OATM enabled ?
Thanks in advanceHello,
I managed to find answer for question 1, yet to find answer for 2 and 3.
Answer for question 1 --
Data objects : store and access business data (tables, indexes, sequences, index-organized tables, etc);
Code objects : process data objects but them don't contains business data (functions, procedures, packages, views, synonyms);
Now, here i have a question - under which objects queues are considered ? -
How to alter user defined objects in oracle
Hi all,
Can any one tell me how to alter user defined objects in oracle .
Thanks,
P Prakashprakash wrote:
Hi all,
Can any one tell me how to alter user defined objects in oracle .
DROP
then
CREATE
Handle: prakash
Email: [email protected]
Status Level: Newbie (80)
Registered: Feb 3, 2011
Total Posts: 185
Total Questions: 67 (65 unresolved)
so many questions & so few answers.
How SAD!
Edited by: sb92075 on Sep 22, 2011 9:22 AM -
Want to use sequence object of oracle when loading data in sql loader
Hi,
I want to use sequence when loading data in sqll loader, but the problem is i could not use sequence object of oracle to load the data by sql loader, i can use sequence of sql loader.
I want to use sequence object because in later entries this sequence object will be used.If i use sequence of sql loader how can i use oracle sequence object
Is there any other optionI have a simillar problem, I also want to use a sequence when loading data by the SQL Loader.
My control file is:
load data
infile '0testdata.txt'
into table robertl.tbltest
fields terminated by X'09'
trailing nullcols
(redbrojunos,
broj,
dolazak,
odlazak nullif odlazak=blanks,
komentar nullif komentar=blanks)
And the datafile is:
robertl.brojilo.nextval 1368 17.06.2003 08:02:46 17.06.2003 16:17:18
robertl.brojilo.nextval 2363 17.06.2003 08:18:18 17.06.2003 16:21:52
robertl.brojilo.nextval 7821 17.06.2003 08:29:22 17.06.2003 16:21:59
robertl.brojilo.nextval 0408 17.06.2003 11:20:27 17.06.2003 18:33:00 ispit
robertl.brojilo.nextval 1111 17.06.2003 11:30:58 17.06.2003 16:09:34 Odlazak na ispit
robertl.brojilo.nextval 6129 17.06.2003 14:02:42 17.06.2003 16:23:23 seminar
But all records were rejected by the Loader, for every record I get the error:
Record 1: Rejected - Error on table ROBERTL.TBLTEST, column REDBROJUNOS.
ORA-01722: invalid number -
Implementing Objects in Oracle Forms
Am preparing for my Forms exam and would really appreciate it if anybody knew where i could get online info/resource with examples on how to implement and manage objects in Oracle forms. Have downloaded 10g and the associated documentation about 200Mb which has got everything except detailed info on Oracle Forms and implementing objects.
Thanks
GusThank you Rosario, not exactly what i was looking for at this moment but certainly something i will use as i will want to use PJCs, a very valuable link, thank you again :)
What i want to find out is there a similar type of guide to implementing object tables with relational tables in a simple form, as i have given it a try and haven't really got anywhere, so a step wise guide would be great.
Cheers
Gus -
I need to demo Oracle Linux 6 in order to see if it will be a fit in our hosting environment. Unfortunately I cannot install updates or any packages that were not chosen during the installation process unless I pay for a support contract/machine.
The main use is to try out the clustering for a High Availability Web/Database environment which would require a minimum of 3 servers. Are there demo licenses to allow for package updates/installs prior to purchasing the contract and wasting money on something that may not work?
PS - No one in any call centre could answer this simple question and I was directed to this public forum to discuss a private Corporate purchasing inquiry.I need to demo Oracle Linux 6 in order to see if it will be a fit in our hosting environment. Unfortunately I cannot install updates or any packages that were not chosen during the installation process unless I pay for a support contract/machine.That is not quite true. Oracle Linux is free to download and free to use for any purpose. You can get the ISO's from http://edelivery.oracle.com/linux or from the http://public-yum.oracle.com YUM repository. You can install or remove RPM packages at will, any combination, any time.
Oracle support (patches, updates, and such) does cost, Oracle does sell their expertise in this way.
The way to engage Oracle is to ask Oracle Sales for a "proof of concept" arrangement. They can help you make sure your setup is valid, supported, and that your test is successful. Oracle support personnel do not get involved with licensing or evaluations, so no wonder you got no joy via that path.
Go sales. Go early :) -
What are type object in oracle?
please give relevent info about types?
thanks
yashi read a interview question,
Q, whar are the diffrent objects in oracle?
ans.
Synonym
Table
View
Trigger
Materialized Views
Indexes
Sequence
LOB
Package
Package Body
Function
Procedure
Type
please explain: Type -
How can i return object from oracle in my java code using pl/sql procedure?
How can i return object from oracle in my java code using pl/sql procedure?
And How can i returned varios rows fron a pl/sql store procedure
please send me a example....
Thank you
nullyes, i do
But i can't run this examples...
my problem is that i want recive a object from a PL/SQL
//procedure callObject(miObj out MyObject)
in my java code
public static EmployeeObj callObject(Connection lv_con,
String pv_idEmp)
EmployeeObj ret = new EmployeeObj();
try
CallableStatement cstmt =
lv_con.prepareCall("{call admin.callObject(?)}");
cstmt.registerOutParameter(1, OracleTypes.STRUCT); // line ocurr wrong
//registerOutParameter(int parameterIndex, int sqlType,String sql_name)
cstmt.execute();
ret = (EmployeeObj) cstmt.getObject(1);
}//try
catch (SQLException ex)
System.out.println("error SQL");
System.out.println ("\n*** SQLException caught ***\n");
while (ex != null)
System.out.println ("SQLState: " + ex.getSQLState ());
System.out.println ("Message: " + ex.getMessage ());
System.out.println ("Vendor: " + ex.getErrorCode ());
ex = ex.getNextException ();
System.out.println ("");
catch (java.lang.Exception ex)
System.out.println("error Lenguaje");
return ret;
Do you have any idea? -
Sql script files to recreate SYS objects in Oracle 9i
Hello all.
I am working with a test Oracle database which is missing some SYS objects. (Oracle 9i).
I was wondering if Oracle has any scripts that I can run and recreate those?
Thank you,
Sonyacatalog.sql only creates the data dictionary views , not the underlying tables and indexes.
(sql.bsq is the "internal" script that is executed to create objects in the SYS schema when a CREATE DATABASE command is issued --- but Oracle will not support anyone attempting to use this script directly).
Hemant K Chitale -
Hello experts, I am using oracle 11g.I have a sequence to generate some ids.If I want that my sequence has been reset like i will start from starting again.It is possible to re initiate a sequence object in Oracle.If it is my client's requirement. Thank You regards aaditya
You could always use ALTER SEQUENCE
or simply re-create your sequence. However this may invalidate database objects.
cheers
Maybe you are looking for
-
Time Capsule as wireless router
With Apple Support, I set up my new Time Capsule as my wireless router. I am able to use this network with my iPad, iPhone & iMac. My husband is unable to access this wireless network with his PC laptop & Noika phone; he could access my previous wir
-
Suddenly, my MBP Won't get an internet connection through my routers
I've had my MBP 15" 2.4 for about three months now, and I've never had a problem connecting to the internet. This morning I booted it up, but when I went to get on a wireless connection it would connect, but still say I had no internet. I have two ro
-
Moving items generates "cannot be modified...must authenticate" message
My mom has a new MacBook Pro running 10.4.11, and she is getting these annoying "cannot be modified...must authenticate" messages when she tries to move files off her desktop into other folders, or into the trash. I have tried the following: 1. repai
-
Chaps, We've got couple of Templates built for BW Reporting. Now, in the SAP Portal I noticed that the BW reports are shown in different customized web templates. My question is, (1) Can we have multiple Web Templates published in SAP
-
IPhoto cannot open with Yosemite
Hi guys! I have updated my MacBook Pro on Yosemite and iPhoto cannot open. It asked for an update from Apple store, which I did. Now there are 2 icon apps of iPhoto, and none opens. I moved to trash the old one, but still the new did not respond at a