JAVA_OBJECT
Does Oracle8i support the JDBC type JAVA_OBJECT? Where can one find out which JDBC types Oracle8i supports? There's no mention of JAVA_OBJECT in the Oracle8i JDBC Developer's Guide and Reference. Maybe there's a sample I can run that returns the DatabaseMetaData that shows what is supported?
Oracle 8i does not support JAVA_OBJECT, that is writing Java objects directly into SQL columns. Instead, you can do one of two things:
(a) as already pointed out, you can map a Java classes to SQL object types. In this case you would use JPublisher to create a Java wrapper class for a SQL object type.
(b) you serialize/deserialize instances of your Java object in RAW or BLOB columns.
Similar Messages
-
Can we create java_object data type in oracle procedure
i want to construct java_object like data stucture in oracle procedure, then i have to retrieve the object
via callable statement. is it possible? or any other solutions?i want to construct java_object like data stucture in
oracle procedure, then i have to retrieve the object
via callable statement. is it possible? No.
or any other
solutions?Of course. Return the data, and construct it in java. -
JAVA_OBJECT support in Oracle 9i
Hi,
I'd like to find out if Oracle 9i supports java.sql.Types.JAVA_OBJECT as specified in JDBC 2.0. I'd like to store serializable Java objects directly in the database and let the JDBC driver handle the serialialization and deserialization. Is there a way that I can do this with Oracle 9i?
Thanks.don wrote:
My question is: does Oracle JVM supports multithreading or not? If yes, how to achieve it? Maybe there is something handled in JDBC? (although my code useses JDBC is not multithreaded) If this is not possible with java, do you now how to run something (oracle function, procedure) concurrently with PLSQL? (I tried with DBMS_JOBS but it does not work on all my databases and our DBAs discourage the use of them). Performing multithreading my launching different sqlPlus processes is not an option (as we have no security standard regarding the authentication -> connection is made by specifying in clear text the user and password).
(Obviously the other post answers your question.)
If I am reading that correctly then you have a management issue - not a technological one.
You have a task to complete, presumably doing it efficiently is something that the company wants.
And you have two alternatives both of which the DBAs are not allowing you to use.
So at that point it is up to management to insist that the DBAs provide specific technological reasons (not hand waving) why those solutions are not suitable. And they should also be required to provide the outline of an alternative that is suitable.
Besides that you might consider why your solution cannot be implemented entirely in a single threaded PL/SQL routine. The fact that is harder is not a reason when the point of the excercise is to create something that is more efficient. -
RegisterIndexTableOutParameter of JAVA_OBJECT-elemnt raises Invalid column
i wrote below code
---------------Oracle ---------------------
CREATE OR REPLACE PACKAGE K_WD_COMMON AUTHID CURRENT_USER IS
TYPE TYPEREC IS RECORD(
COL1 VARCHAR2(50),
COL2 NUMBER(3)
--TYPE TYPETAB IS TABLE OF TYPEREC INDEX BY BINARY_INTEGER;
TYPE TYPETAB IS VARRAY(100) OF TYPEREC;
END K_WD_COMMON;
CREATE OR REPLACE PROCEDURE WDTEST_PRC_NESTED_TABLE(TESTTAB OUT RMS.K_WD_COMMON.TYPETAB) AS
BEGIN
TESTTAB(1).COL1 := 'TEST1';
TESTTAB(1).COL2 := 1;
TESTTAB(2).COL1 := 'TEST2';
TESTTAB(2).COL2 := 2;
RETURN;
END;
---------------java code ---------------------
Connection conn = DriverManager.getConnection(url, "a", "a");
ResultSet rs = null;
//System.out.println("ARRAY : " + Types.ARRAY);
String sql = "{CALL RMS.WDTEST_PRC_NESTED_TABLE( ? )}";
OracleCallableStatement cs = (OracleCallableStatement) conn.prepareCall(sql);
//cs.registerOutParameter(1, OracleTypes.PLSQL_INDEX_TABLE);
//cs.registerIndexTableOutParameter(1, 100000, OracleTypes.OTHER, 0);
cs.registerIndexTableOutParameter(1, 100000, OracleTypes.JAVA_OBJECT, 0);
-----------it raises below error
java.sql.SQLException: Invalid column type
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:6411)
at oracle.jdbc.driver.OracleCallableStatement.registerIndexTableOutParameter(OracleCallableStatement.java:2271)
at WDLib.prcNestedTable(WDLib.java:67)
at WDLib.main(WDLib.java:82)
isn't it possible?
thanks in advance.
regards
KiyongKiyong,
If I remember correctly, "record" types are not supported, but in any case, the type must be declared globally -- it cannot be declared within a (PL/SQL) package. You need to define the type using the "create type ..." (SQL) statement.
Please refer to the java documentation for more details. The documentation is available from:
http://tahiti.oracle.com
Also, the following Web page has links to sample code that demonstrates the use of ARRAYs:
http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
Good Luck,
Avi. -
Re: [iPlanet-JATO] Double Trouble
Looks like the attachment will not be inlined by egroup's mailer so here is
the table i was trying to send before:
Current Type mapping (appologies for lousy formatting)
ND ColumnDataType DATA_FIELD_TYPE_MAP
DATA_FIELD_SQL_TYPE_MAP
NO_TYPE String
java.sql.Types.VARCHAR
CHAR_TYPE String
java.sql.Types.CHAR
UNSIGNED_CHAR_TYPE String
java.sql.Types.CHAR
TINY_TYPE Short
java.sql.Types.SMALLINT
UNSIGNED_TINY_TYPE Short
java.sql.Types.SMALLINT
SHORT_TYPE Short
java.sql.Types.SMALLINT
UNSIGNED_SHORT_TYPE Short
java.sql.Types.SMALLINT
INT_TYPE Integer
java.sql.Types.INTEGER
UNSIGNED_INT_TYPE Integer
java.sql.Types.INTEGER
LONG_TYPE Long
java.sql.Types.BIGINT
UNSIGNED_LONG_TYPE Long
java.sql.Types.BIGINT
FLOAT_TYPE Float
java.sql.Types.FLOAT
DOUBLE_TYPE Double
java.sql.Types.DOUBLE
DECIMAL_TYPE java.math.BigDecimal
java.sql.Types.DECIMAL
DATE_TYPE java.sql.Date
java.sql.Types.DATE
DATETIME_TYPE java.sql.Timestamp
java.sql.Types.TIMESTAMP
DURATION_TYPE DONT_KNOW_CLASS_TYPE
DONT_KNOW_CLASS_TYPE
STRING_TYPE String
java.sql.Types.VARCHAR
BLOB_TYPE Object
java.sql.Types.BLOB
UNQUOTED_STRING_TYPE DONT_KNOW_CLASS_TYPE DONT_KNOW_CLASS_TYPE
BOOLEAN_TYPE Boolean
java.sql.Types.BINARY
USER_DEFINED_TYPE DONT_KNOW_CLASS_TYPE
java.sql.Types.JAVA_OBJECT
Translation Tool Type Mapping Structures
The current code generation structures that are responsible for supporting
these type mappings at translation times are as follows:
CodeGeneration.DATA_FIELD_TYPE_MAP
The map is constructed from two arrays:
CodeGeneration. ND_DATA_FIELD_DATA_TYPES
CodeGeneration. MIGRATION_MODEL_DATA_TYPES
CodeGeneration. DATA_FIELD_SQL_TYPE_MAP
The map is constructed from two arrays:
CodeGeneration. ND_DATA_FIELD_DATA_TYPES
CodeGeneration. MIGRATION_MODEL_DATA_TYPES
JATO Type Values
The following JATO field values or member types are generated at translation
time based on the type mappings:
Model Field typing
Model.member field type - drawn from CodeGeneration .DATA_FIELD_TYPE_MAP
Descriptor typing
QueryFieldDescriptor.fieldClass
- drawn from CodeGeneration .DATA_FIELD_TYPE_MAP
StoredProcParameterDescriptor.fieldClass
- drawn from CodeGeneration .DATA_FIELD_TYPE_MAP
StoredProcParameterDescriptor.sqlType
- drawn from CodeGeneration.DATA_FIELD_SQL_TYPE_MAP
----- Original Message -----
From: Mike Frisino <Michael.Frisino@S...>
Sent: Thursday, January 04, 2001 12:19 PM
Subject: Re: [iPlanet-JATO] Double Trouble
Thanks John,
Can you provide some more information that would help resolve this issue.
It could be that the mapping rules we use during the translation need tobe
adjusted.
Specifically, what were the following ND property values you had for the
field in question:
ND Datafield property "ColumnDataType"
ND Datafield property "ColumnDataTypeText"
ND Datafield property "NativeType"
ND Datafield property "NativeTypeText"
You see, during the translation we had to choose to map from the originalND
type information to a corresponding java or java.sql type.
We were not certain whether to favor ND's "ColumnDataType" or ND's
"NativeType" value.
We came up with rules based on mapping ND's ColumnDataType. Those rulesare
detailed in the attachment.
----- Original Message -----
From: <john.teceno@b...>
Sent: Thursday, January 04, 2001 7:33 AM
Subject: [iPlanet-JATO] Double Trouble
Hey Guys,
I've run across a problem retrieving Doubles back from an Oracle
Database. The field is defined as a Number. When we converted the
program from NetD, it was created with return values of Double. What
is returned is not the correct value. For example, in the table the
value is 123456, when I do a getInternalID(), it is returning 2.0. I
am working on a work around, but I thought that I would post this
anyway.
John Teceno
Back Bay Technologies
[email protected]
[Non-text portions of this message have been removed]
[email protected]Thank you - Jin and Todd.
Will try that.
Atul
--- In iPlanet-JATO@y..., Byung Jin Chun <bchun@n...> wrote:
try using kregedit and modify the key for the jvm args, using the -x
parameters for the 1.2 runtime
Jin
-----Original Message-----
From: Todd Fast [mailto:<a href="/group/SunONE-JATO/post?protectID=101233080150035167169232031248066208071048">Todd.Fast@S...</a>]
Sent: Tuesday, February 19, 2002 8:40 PM
Subject: Re: [iPlanet-JATO] Re: OutOfMemoryError
Atul--
Out of curiosity - How do you modify the memory parameters for
the container's VM ?? I know I should try to do some research but
figured you may already have some insight and willingness to
share.
Please consider this as low priority.It differs by container; I don't remember details of any particular one.
>
Todd
For more information about JATO, including download information, please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
<http://developer.iplanet.com/tech/appserver/framework/index.jsp>
[Non-text portions of this message have been removed] -
Connection/data source caching in JSC App Server?
Tried to change the data source for one of my apps (changed all data sources on all row sets). I got a connection error despite the fact that the IDE could see the data source.
I restarted the app server to no avail.
I finally stopped the app server AND restarted JSC and eveything started working again (except for the Conversion error I'm tracking down :-) ...Did the connection error occur at runtime ?
If so, then it's not recommended to change the datasource
especially if you change databases. It's not impossible to make
the changes - you need to edit the Page bean constructor and the
constructor in the SessionBean and anywhere else you
initialize the rowset with the URL.
If you changed the database, then because vendors
map JDBC types differently, you may need to make
changes . Typically you'll see conversion errors when changing
the database.
JDBC Type (which we call SQL Type) --> Java Type:
=========================================
CHAR --> java.lang.String
VARCHAR --> java.lang.String
LONGVARCHAR --> java.lang.String
NUMERIC --> java.math.BigDecimal
DECIMAL --> java.math.BigDecimal
BIT --> boolean
BOOLEAN --> boolean
TINYINT --> byte
SMALLINT --> short
INTEGER --> int
BIGINT --> long
REAL --> float
FLOAT --> double
DOUBLE --> double
BINARY --> byte[]
VARBINARY --> byte[]
LONGVARBINARY --> byte[]
DATE --> java.sql.Date
TIME --> java.sql.Time
TIMESTAMP --> java.sql.Timestamp
CLOB --> java.sql.Clob
BLOB --> java.sql.Blob
ARRAY --> java.sql.Array
DISTINCT --> (mapping of underlying type)
STRUCT --> java.sql.Struct
REF --> java.sql.Ref
DATALINK --> java.net.URL
JAVA_OBJECT --> (underlying Java class)
Source: JDBC 3.0 Specification, Appendix B
Also, see this post for more info :
http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=47015
John
JSC QA -
Using Refcursor in Callable Statement without using the Oracle Drivers
Hello all,
Is there anyway to have a stored procedure (Oracle 8i) return a refcursor to my CallableStatement without using the Oracle Thin drivers (i'm now using jdbcodbc). I've tried registering my out parameter with every possible type i can think of...REF, JAVA_OBJECT, OTHER, etc. but with no luck.
Help!!!!Certainly...I connect to the database using the
jdbcodbc driver and when i execute any of the code, i
get the following error:
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-06550:
line 1, column 7:
PLS-00306: wrong number or types of arguments in call
to 'PVISUAL_GET'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
It's bombing on the line that i attempt to register
OracleTypes.CURSOR. It works fine when i use the
oracle thin drivers, but i want to get this puppy
working with the JdbcOdbcDriver. Here's the code:
CallableStatement dbCall =
nt dbCall =
(CallableStatement)connection.prepareCall("{ call
PAK_VISUAL_GET.pvisual_get(?, ?, ?, ?, ?, ?) }");
dbCall.setString(1, sessionKey);
dbCall.setInt(2,
l.setInt(2, Integer.parseInt(storedVizID));
dbCall.registerOutParameter(3,
arameter(3, OracleTypes.CURSOR);
dbCall.registerOutParameter(4,
arameter(4, OracleTypes.NUMBER);
dbCall.registerOutParameter(5,
arameter(5, OracleTypes.VARCHAR);
dbCall.registerOutParameter(6,
arameter(6, OracleTypes.NUMBER);
dbCall.execute();when you don't use oracle thin driver, you cannot use the OracleTypes. but, instead use the java.sql.Types values.Replace dbCall.registerOutParameter(3, OracleTypes.CURSOR); with
dbCall.registerOutParameter(3,java.sql.Types.OTHER). things should be fine.
Ganesh -
SQL user defined type mapping with Java Class type
SECRET_TAB_TYPE is userdefined type in SQL Schema. but accessing this way it is giving invalid column type error(see code below )??
I have made a class with same name attributes as in SQL Type
Connection con = DriverManager.getConnection(URL,Username, Password );
java.util.Map map = con.getTypeMap();
map.put("SchemaName.SECRET_TAB_TYPE",Class.forName("SECRET_TAB_TYPE"));
CallableStatement pstmt = con.prepareCall( "{ call smartapi.FetchSharedSecret(?,?,?,?,?,?) }" );
pstmt.setString(1,"SM");
pstmt.setString(2,"BT");
pstmt.setString(3,"COM");
pstmt.registerOutParameter(4, Types.JAVA_OBJECT);//
pstmt.registerOutParameter(5,Types.VARCHAR);
pstmt.executeQuery();
secret_tab=(SECRET_TAB_TYPE)pstmt.getObject(4);
message= pstmt.getString(5);STATS_T_TEST_
docs.oracle.com/cd/B19306_01/server.102/b14200/functions157.htm
STATS_T_TEST_ONE: A one-sample t-test
STATS_T_TEST_PAIRED: A two-sample, paired t-test (also known as a crossed t-test)
STATS_T_TEST_INDEP: A t-test of two independent groups with the same variance (pooled variances)
STATS_T_TEST_INDEPU: A t-test of two independent groups with unequal variance (unpooled variances) -
SQLAssembler: Handling dates
I'm just wondering if anyone has had any luck using date/time
fields with SQLAssembler, as I'm having a few problems.
My update query declaration looks like this:
<update-item>
<sql>UPDATE Timesheet SET person=#person#,
<sniiiiip, lots of fields>, date=#date# WHERE id=#_PREV.id#
</sql>
</update-item>
I'm editing the data from the DataService with an item
editor, which looks something like this:
<mx:itemEditor>
<mx:Component><mx:DateField
formatString="DD/MM/YYYY"/></mx:Component>
</mx:itemEditor>
I'm using an actionscript-class declaration in the
SQLAssembler config, and it that class the var named "date" is of
type Date.
My database is an Access MDB connecting with
sun.jdbc.odbc.JdbcOdbcDriver.
If I remove the part which sets the date field (date=#date#)
from my update query, everything works perfectly.
I have LCDS set to show all debug messages, and this is the
error shown when I exit the date field after changing it:
When I set editorDataField="selectedDate" I get the following
error:
[Flex] 16:19:50.468 [DEBUG] [Service.Data.SQL] SQL Assembler
jdbc exception on operation=update-item
error=java.sql.SQLException: SQL Exception : Unknown SQL Type for
PreparedStatement.setObject (SQL Type=1111
And if I set editorDataField="text" (which appears to cause
the format string to be applied according to the rtmp message
intercepts), then I get this:
[Flex] 16:27:23.500 [DEBUG] [Service.Data.SQL] SQL Assembler
jdbc exception on operation=update-item
error=java.sql.SQLException: [Microsoft][ODBC Microsoft Access
Driver] Syntax error in UPDATE statement.
And if I then add single quotes around the date field in the
update query ( date='#date#' ), I get this:
[Flex] 16:32:11.156 [DEBUG] [Service.Data.SQL] SQL Assembler
jdbc exception on operation=update-item
error=java.sql.SQLException: Unexpected exception : 7
I've tried various format strings which I think Access should
handle, but they all result in the unexpected exception error. I've
also tried changing the data type on the actionscript class to
String but it still gives the same results.
What would be really handy would be if I could see the exact
query which is being run against the database to try and determine
what is actually being entered when the error occurs.
I've tried
this logging jdbc driver,
but so far I couldn't get it to work with the Access driver and the
trouble shooting documentation is very sparse.
If anyone has any clues on either how I can see the actual
update query SQLAssembler is running or what I need to do to enable
editable date fields I'd be very grateful.
Thanks,
RobertI've now tried with 2 other databases:
MySQL works perfectly.
MSSQL fails with the error "The Java type java.util.Date is
not a supported type."
So this might be a question of whether a specific JDBC driver
can map Java's date object to a field correctly.
EDIT:
I tried experimenting with another JDBC driver to connect to
MSSQL:
jTDS
It failed with a very similar error message, but it can be
tweaked to map the JAVA_OBJECT type to datetime, but there may be
side-effects of this change (e.g. another type without mapping
available defined my now cause a class cast exception rather than
resulting in an sql exception being raised).
In most situations storing the date in a timestamp would be
more appropriate than a datetime field, but as the SQLAssembler
appears to be unable to map Timestamp to anything but ByteArray
this solution doesn't seem feasible here. If SQLAssembler were to
map to java.
sql.Date instead of java.
util.Date, this would also be undesirable as the java.sql
version does not include the time.
If anyone is interested in the tweaks you need to make to the
jTDS driver then post here and I'll put the diff up, but really it
feels "a bit dodgy" to map JAVA_OBJECT jdbc fields to date and
probably not something you'd want to do in production for the sake
of reliability (this is just for a small internal project at my
company).
Now I just need to work out how best to enable people to edit
a time as well as the date in the DateField... -
Prepared Statement and DEFAULT identifier
Does anyone know how to pass the identifier DEFAULT to a PreparedStatement?
I am processing a text file to import into a database table (Oracle 9i) via JDBC. The user is able to configure what will happen if the data in the file doesn't match the types required by the database and so I do a quick check that the data is of the right type before it gets to the database. The user can choose to have the invalid value replaced with the default associated with that field (as configured on the database table). Eg. Table setup is
CREATE TABLE "TEST1" (
"TESTFIELD1" VARCHAR2(40 byte),
"TESTFIELD2" VARCHAR2(40 byte) NOT NULL,
"TESTFIELD3" NUMBER(30, 10) DEFAULT 777)
sample data of 'abc', 'def', 'www' should therefore end up as 'abc', 'def', 777
The problem I have is that I'm using a PreparedStatement to do the INSERTs (there could potentially be thousands of them).
The following SQL is what I'm trying to emulate...
INSERT INTO table (field1, field2, field3) VALUES ('abc', 'def', DEFAULT);
BUT, I am using a PreparedStatment via JDBC with bind variables ...
pstmt = con.prepareStatement("INSERT INTO table (field1, field2, field3) VALUES (?, ?, ?)");
ps.setString(1, "abc");
ps.setString(2, "def");
ps.setsomething(3, something); <- what goes here?
I have no idea what to put in the "something" bits so that DEFAULT is passed through. I obviously can't use setString(3, "DEFAULT"); as I'll just get an Oracle type mismatch error.
I realise that I could just leave out the 3rd variable and the default would be inserted automatically - but because some of the rows in the input file may have a valid value for field3 I don't always want the default value. Using the straight SQL is not an option due to the performance (or lack thereof).
Any ideas would be greatly appreciated! Thanks!As for the best of my knowledge if you set the value to be null in the prepared Statement while setting that
for insert statement internally it is set to DEFAULT in ORACLE..
More over i thought that this will be usefull for u..
setNull
public void setNull(int paramIndex,
int sqlType,
String typeName)
throws SQLExceptionSets the designated parameter to SQL NULL. This version of the method setNull should be used for user-defined types and REF type parameters. Examples of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.
setNull
public void setNull(int parameterIndex,
int sqlType)
throws SQLExceptionSets the designated parameter to SQL NULL.
Note: You must specify the parameter's SQL type.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
sqlType - the SQL type code defined in java.sql.Types
Throws:
SQLException - if a database access error occurs
ALL THE BEST -
Calling a PL/SQL function returning Netsed Table Rows
Hi,
I am trying to call a Function which returns Nested Table rows (as Out Parameter) in Java .
When I am trying to use
pstmt.registerOutParameter(3, OracleTypes.OTHER);
to capture the Out parameter in Java code , I get the follwoing error :
java.sql.SQLException: Invalid column type
I have even tried using OracleTypes.JAVA_OBJECT ,but I get the same error.
If I use OracleTypes.JAVA_STRUCT I get
java.sql.SQLException: Parameter Type Conflict: sqlType=2008
error.
Please help .
Am I doing the right thing ?
Thanks in advance.
Ninadhttp://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/jdbc20/jdbc20.html
-
CFC query union with database query
I'm trying to invoke a webservice to return a query, and then
run a parallel query in another database, and UNION the two with a
query of query. Both the webservice server and the local server are
CF7, both running MySQL, both accessing tables with parallel
structures. The webservice returns what appears to be a normal
query from CFDUMP, but then when I UNION it with the second query,
I get either "Incorrect Select List" or "Columns with index number
equal "1" have diffent types (SMALLINT, JAVA_OBJECT)" errors. So
apparently there's something different about the query from the
webservice that's causing problems?Thanks, this fixed it. I had not realized CF had it's own Q
of Q CAST function. Here's the documentation on it, in case it has
eluded others.
http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=ColdFusion_Documentation&file=00001271.htm
Adobe: It would be nice if the LiveDoc page for a main tag
like CFQUERY would link to all related pages, like this one above.
Then when looking for information on using a particular tag, it
would be much more likely to find the related page. -
Conversion error - Really urgent II
I�ve got 3 Textfield that exhibit a row from a rowset, and I put a save button with the code
public String button1_action() {
// User event code here...
try{
aprovacaoRowSet.updateRow();
aprovacaoRowSet.commit();
info("Alteracao ok");
}catch (SQLException e) {
log("ok" + e);
error("erro" + e); }
return null;What am I doing wrong ? for when I click this button I only got the message:
textfield conversion error occurred
Regards
Marlos Rodriguesfyi here's the how the column types map into your java code...
JDBC Type (which we call SQL Type) --> Java Type:
================================================
CHAR --> java.lang.String
VARCHAR --> java.lang.String
LONGVARCHAR --> java.lang.String
NUMERIC --> java.math.BigDecimal
DECIMAL --> java.math.BigDecimal
BIT --> boolean
BOOLEAN --> boolean
TINYINT --> byte
SMALLINT --> short
INTEGER --> int
BIGINT --> long
REAL --> float
FLOAT --> double
DOUBLE --> double
BINARY --> byte[]
VARBINARY --> byte[]
LONGVARBINARY --> byte[]
DATE --> java.sql.Date
TIME --> java.sql.Time
TIMESTAMP --> java.sql.Timestamp
CLOB --> java.sql.Clob
BLOB --> java.sql.Blob
ARRAY --> java.sql.Array
DISTINCT --> (mapping of underlying type)
STRUCT --> java.sql.Struct
REF --> java.sql.Ref
DATALINK --> java.net.URL
JAVA_OBJECT --> (underlying Java class)
Source: JDBC 3.0 Specification, Appendix B -
How can I drop the java objects from a schema
hi..good afternoon all...
How can I drop the java objects from a database schema???
suppose the credentials are scott/tiger@db1
Another thing is that...I have to do this from cmd(command prompt) as there is no plsql developer or sqldeveloper installed in the machine.
plss help...thanks in advance...hi...i have already tried all the options..but it is showing the error..
ora:01435 - user does not exist
but when i have given the command...
select object type, object_name, status from user_objects where object_type like'%JAVA%';
then it is showing that the java_object is present....
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>
SQL>
SQL> set linesize 200
SQL>
SQL>
SQL>
SQL> select object_type, object_name, status from user_objects where object_type
like '%JAVA%';
OBJECT_TYPE OBJECT_NAME
STATUS
JAVA CLASS javaclass1
VALID
JAVA SOURCE javaclass1
VALID
SQL> drop java source javaclass1.java;
drop java source javaclass1.java
ERROR at line 1:
ORA-01435: user does not exist
SQL> -
How to write call specs for a java stored procedure that takes a nested obj
Example Class :
public class B {
int number;
String str;
public class A {
private B[] _childern;
public B[] getChildern(){
return _children
public static void saveAll(A a) throws SQLException {
B[] children = a.getChildern();
for(int i=0; i<children.length; i++){
saveChild(children);
public static void saveChild(B ch)throws SQLException {
// do something
What would be the call specification for the method A.saveAll(A)? Your help will be apprecited.
Thank you
AjmalIn other words, How to pass a Java Object from a Java stored procedure to a Java client ???
Hello,
I don't know to deal with a Vector object that has been generated from a stored procedure.
Should I create first in the JDBC client and pass it as argument to the procedure ?
Thanks in advance. Here is an extract ...
On the client side :
<<
Vector buffer = new Vector();
CallableStatement call =
con.prepareCall ("{call my_procedure_run (?, ?)}");
call.registerOutParameter(2, java.sql.Types.JAVA_OBJECT );
call.setString (1, "bla bla bla");
call.setObject (2, buffer);
call.execute ();
buffer = (Vector)call.getObject (2);
>On the Java stored procedure
<<
public class my_procedure
public static void Run(String input_value, Vector buffer)
// ??? Vector buffer = new Vector();
try
while ( true )
buffer.addElement(...) ;
catch(Exception ex) { }
Maybe you are looking for
-
Unable to open Enterprise Manager in web browser
Hi All, I have configured EM in my single instance database in Windows server 2008 inside VMware . But i am unable to open em in web browser. C:\Users\Administrator>emctl status dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.
-
Exchange Rate calculation mismatch in Sales Order Invoice and Cancelled Invoice
Hi, In Sales Invoice, Exchange Rate is maintained as 7.75132 Invoice Amount is 72000 USD. So the Amount calculated should be 558095.04. But in Accounting Document the Amount is posted as 558095.15 for the GL Sales Account. In Cancelled Sales Invoice,
-
How to pass values to dashboard prompts from external applications
Any idea is well appreciated. How can I pass values of dashboard prompts from external applications to the dashboard prompts so that the dashboard is prefiltered based on values sent by external applications. Thanks in Advance! Kris
-
CR runtime 13: report not displayed in production environment
Hi, i've the following situation.. i'm developing on VS2010 a webapp using the final release of CRfVS2010 (s.o. is Windows 7 Ent x64) without any problems. Today i'm trying to test the app on a server (Windows Server 2003 with CR2008 redist already i
-
Hey everyone, i recently just purchased the 16 GB i phone and received it today, i got a couple songs off my playlist to sync to my phone and i even bought a ringtone and it goes automatically to the IPOD part of my phone, how do i get it so i can us