JAVA NATIVE TYPES
Hi everyone,
Can anyone let me know what are java native types and its purpose?
Regards,
Subrat
Hi Subrat,
I assume you are asking about the Java Native Types option while creating context attribute. Java native types give you the ability to assign the Java Classes as types for your context attributes. that means you can create your context attributes based on Java Classes. They are useful when you have to store some data in the context attributes for which no direct type is given by Web Dynpro.
Regards,
Ajay
Similar Messages
-
Problem with Java Native Type after Migration from 7.0 to 7.1
Hi,
after Migration from Netweaver 7.0 to Netweaver 7.1 I get following error:
FileDownload 'FileDownload.data': Context attribute 'PrintSelectedView.PdfToDownload.resourceInputStream' has the Java native type 'com.sap.tc.webdynpro.progmodel.api.IWDInputStream' and cannot be bound to this property. Hint: Remove the binding or bind a context element matching the property's type.
What have I done wrong?
How could I fix this problem?
Best regards,
PeterHi,
thanks, this solved the problem.
Thank you.
Best regards,
Peter -
Conversion of Packed Decimal Numbers to Java Data Types
Hi all,
I'm working with a mainframe file which contains datas in Packed Decimal Numbers.My requirement is to convert these datas to Java datatypes and also to convert the Java datatypes to Packed Decimal Numbers before storing them in the mainframe.
Can anyone help me out with any code for converting Java data types to/from other data formats such as: EBCDIC, IBM370 COMP (binary numbers up to 9 digits), and COMP-16 (packed decimal numbers)?
I would hugely appreciate any response to my query.
Thanking you all,
Kaushik.Rather than go that route, I'd instead look into providing a "service" on your mainframe to:
1) provide a textual representation of the numbers (from native to text)
2) read text, converting to native numeric storage
And use that service to retrieve that information by your Java app (1)Similarly, instead of trying to write natively-formatted numbers from your Java app, I'd write it as text and make that same "service" read the text (2)
This is the kind of thing XML is for. -
Java Step Types with Java Virtual Machine higher than java-6u16?
Documentation of Java steps says, that these steps are tested with java version 6 update 16. I am talking about the java step types that can be found in directory <TestStand Public>\TestStand 2010\Examples\Java.
If I install another java version, e. g. java 7, step "Start JVM" will exit with an error "-4" and error message "Could not launch JVM.". While Debugging source code of JavaCall.dll, I figured the failing code line out:
"fpCreateJVM(&jvm,(void**)&env,&vm_args);" is the execution of function "JNI_CreateJavaVM" and returns error code -4.
Till now I could not find out, why the jvm does not start. I guess -4 means "Insufficient memory to create the JVM." (http://zone.ni.com/reference/en-XX/help/370052J-01/tssuppref/infotopics/java_steps_errors/)
Has anyone an advice for me?This post gave me a hint: http://stackoverflow.com/questions/3400292/jni-enomem-from-jni-createjavavm-when-calling-dll-that-us...
Though my development computer has enough ram, jvm is started within the Teststand process which offers limited memory. I changed JavaCall.c and added parameter "-Xmx64m" to the jvm creation call. Now it works with jre 7.
Because memory space Teststand offers to the jvm is different on different computers, an implementation would be nice that checks how much memory is available and then passes the calculated <MEM> as parameter "-Xmx<MEM>m". Here is an example implementation: https://forums.oracle.com/forums/thread.jspa?threadID=1546540 -
Java.sql.types and oracletypes
There appear to be difference in the way the constants are mapped in java.sql.types vs oracletypes(). For example date is '91' in oracletypes and '93' in java.sql.types. The DatabaseMetaData.getColumns() function reports data_type as a java.sql.type. Is there any mapping available from one to the other.
ThanksErm,
One way to find out, I reckon.
Good Luck,
Avi. -
External SOAP client Accessing Webservice using built in Java Data type
We have built a webservice and deployed it on WLS. We accessed this from a swing
client it works fine.The webservice methods uses non-built in JAVA data types
as parameters.These are Value Objects and the JAVA Serializer and Deserializer
classes are generated using Ant task itself.The client coding uses Value objects
given by the Client_jar (generated using <Clientgen> ant task) to pass to the
webservice. We dont want to go by this way.Is there anyway were in we can pass
parameters to the method which expects non-built in java datatypes?
Why i am asking this is, i want to know how an external client (.Net client )
will be able to exceute my webservice (i.e., passing the required Object which
the method is expecting)?Hi Anish,
Well first off, your web service doesn't send or receive "objects". It only sends
and recieves XML, which is in turn converted to/from Java objects at invocation
time. Second, a .NET (or Perl, or Python, or C++) client will be able to call
your web service, because the wsdl.exe tool (for .NET) will generate "programming
language specific" objects from the <types><schema> elements, in the WSDL of your
web service :-) The wsdl.exe tool will create C# objects from the WSDL, that will
convert XML to/from C# when your web service is called. That's the beauty of XML
schema - it's a "universal typing system", so it's not tied to a particular programming
language. The only issue is whether or not the web services platform vendor's
XML Schema/WSDL processor, can successfully process the WSDL. Some vendors have
more complete implementations of the WSDL and XML Schema specs than others, so
expect varying success here. The one in WLS 7.0 is pretty good, so you shouldn't
have too many problems consuming WSDL generated by .NET tools (or any other tool
for that matter).
Regards,
Mike Wooten
"Anish" <[email protected]> wrote:
>
We have built a webservice and deployed it on WLS. We accessed this from
a swing
client it works fine.The webservice methods uses non-built in JAVA data
types
as parameters.These are Value Objects and the JAVA Serializer and Deserializer
classes are generated using Ant task itself.The client coding uses Value
objects
given by the Client_jar (generated using <Clientgen> ant task) to pass
to the
webservice. We dont want to go by this way.Is there anyway were in we
can pass
parameters to the method which expects non-built in java datatypes?
Why i am asking this is, i want to know how an external client (.Net
client )
will be able to exceute my webservice (i.e., passing the required Object
which
the method is expecting)? -
Java.sql.Types.??????
I know clob columns in an oracle database are java.sql.Types.CLOB. What are long raw columns defined as java.sql.Types.???
Thanks in advance,
kmwHi ,
Long has no correspondng type in Oracle.sql.Types.So u can access it using the getOBject and setObject.Why do u need to defing the long ?Is it for use i the getter and setter methods of ResultSet or Statements.If so , u have to use streaming and so there is really no need to worry abt the type definition as u are defaulting to an AsciiStream.
Hope it helps. -
How to use the java native api
i am new to the java native api, can anyone tell me how to use it in order for me to use the c++ file in the java file?please explain it if possible, thanks
Try this out to learn the basics :
http://java.sun.com/docs/books/tutorial/native1.1/index.html
You can't go wrong from there. -
HI,
I have a big problem with Java Native Access when call a function in dll file.
First, I have files xxx.dll,xxx.h (written by my partner) and document for functions.
Second, I am using JNA (java native access) to call the functions.
But, it has some functions that function's result is pass over memory of window.
In document description, it has tow constant: WM_USER = 0x0400, WM_USER_ENV = (WM_USER + 0)
I have just learn, so i don't know about that.
So, my problem is " i don't know how to get result of function that passed over to memory window )
This is my header file: MFSIOCTL.h
// Command
#define CMD_VERSION 'V'
#define CMD_SENSOR 'S'
#define CMD_FLICKER 'L'
#define CMD_GETSTATUS 'A'
#define DEST_1 '1' //front door / Card Reader Flicker Lamp
#define DEST_2 '2' //UPPER FRAME IN POSITION(CDM) / Printer Lamp
#define DEST_3 '3' //Receipt Exit Sensor / Cheque Lamp
#define DEST_4 '4' //Cheque Door Sensor / A4 or Cash Lamp
#define DEST_5 '5' //Bill Hopper Sensor - 2006/06/20 added
#define DEST_ALL '0' //Get all Status
//switch status or FLicker Lamp on/off
#define OPEN '0' //Flicker Off
#define CLOSE '1' //Flicker On
//added at 2004/09/17
#define WM_MFS_IO_OFFSET (WM_USER+0x900)
#define WM_MFS_IO_CHG_EVT (WM_MFS_IO_OFFSET + 0)
extern "C" __declspec(dllexport) BOOL __stdcall MFSIO_Open(HWND hWnd,BYTE comport);
extern "C" __declspec(dllexport) BOOL __stdcall MFSIO_Close(void);
extern "C" __declspec(dllexport) BOOL __stdcall MFSIO_GetVersion(LPSTR lpFWVer,LPSTR lpDLLVer);
extern "C" __declspec(dllexport) BOOL __stdcall MFSIO_LED(BYTE LEDNum,BYTE OnOff);
extern "C" __declspec(dllexport) BYTE __stdcall MFSIO_GetStatus(void);
And this is window message define:
--- Definition of Window Message
: Message is defined in MFSIOCTL.h as bellows.
#define WM_MFS_IO_OFFSET (WM_USER+0x900)
#define WM_MFS_IO_CHG_EVT (WM_MFSS_IO_OFFSET + 0)
MESSAGE WPARAM(Indicator ofDoor or Media) LPARAM(Status of Door or Media)
WM_MFSS_IO_CHG_EVT DEST_1 or OPEN or CLOSE
DEST_2 or
DEST_3 or
DEST_4
Refer to MFSIOCTL.h
In functions, i don't know that they relative with parameters as "WM_MSF_IO_OFFSET, WM_MFS_IO_CHG_EVT'' and parameters use for what?
How to get value of window message?
Please help me. Thank you.
Edited by: QuocTan on Sep 8, 2010 9:31 PM
Edited by: QuocTan on Sep 8, 2010 9:34 PMBut, it has some functions that function's result is pass over memory of window.I have no idea what that means. Please try again in standard English.
In document description, it has two constant: WM_USER = 0x0400, WM_USER_ENV = (WM_USER + 0)
These are Windows constants. I don't understand the relevance.
So, my problem is " i don't know how to get result of function that passed over to memory window)*My* problem is that this is about the 4th time I've read this statement and it doesn't make any sense. What is a 'memory window'? What is 'memory of window'?
#define WM_MFS_IO_OFFSET (WM_USER+0x900)
#define WM_MFS_IO_CHG_EVT (WM_MFS_IO_OFFSET + 0)If these lines are the problem, they have nothing whatsoever to do with JNI or this forum.
In functions, i don't know that they relative with parameters as "WM_MSF_IO_OFFSET, WM_MFS_IO_CHG_EVT'' and parameters use for what?Eh?
How to get value of window message?What?
Please help me.I cannot help either of you until you take the trouble to express yourselves clearly in standard English. Your problem doesn't appear to have anything to do with JNI or JNA. More likely it is an elementary Windows API programming problem, which is irrelevant to this forum and this site. -
Create table dinamically using java sql types?
Hi! I've an application that reads an XML file. This file contains de definitions of some tables, using java sql types. For example:
<dbtable>
<dbtablename>Name of table</dbtablename>
<dbtablefield>
<name>Name of table field</name>
<type>java.sql.Types.VARCHAR</type>
<length>10</lenght>
<canNull>0</canNull>
<isPK>1</isPK>
</dbtablefield>
</dbtable>That's a little example of one table, with one field. Is a java.sql.Types.VARCHAR (or is equivalent in int), which has a size of 10, it cannot be null and is a primary key for the table.
Now, the lenght, null, and primary keys are not problem at all. What I want to know, is how do I create de table using the java.sql.Types. I mean, I don't want to hard code:
String s = "CREATE TABLE name (COLUMN VARCHAR(10)...";Instead, I want to use some "wild cards", as are used in PreparedStatement. The idea of this is that no matter what DB I'm using, I must always be capable of creating the tables not worrying for the DB. I mean, I must be able to create the table in Oracle, SQL Server, DB2, etc., using the same XML and the same java class.
Something like:
String s = "CREATE TABLE name (COLUMN ? (10)...";
someobject.setObject(1,java.sql.Types.VARCHAR);
someobject.execute(); //create tableIs this possible? Or do I have to make a map for each DB?
Thanks a lot for your help! Dukes available!you can provide some fields at runtime..
for example
"CREATE TABLE name (COLUMN" + arg[1] +"(10)..."
here arg is the string array passed into the main. -
Simple java archive type deployment is invalid in Jdeveloper 9031
Hi All,
If I choose a Simple Java archive type of deployment of a jsp tag lib project in Jdeveloper the archive does not include the directory layout recursively. Ex. I get this.
c:\> jar tvf test.jar
64 Sat Jan 01 23:53:48 PST 2000 META-INF/MANIFEST.MF
1300 Sat Jan 01 23:53:48 PST 2000 META-INF/autodate.tld
5772 Sat Jan 01 23:53:48 PST 2000 test/autodate.class
Where if I do it the archiving from the comman line. i.e
c:\> jar cvf test.jar META-INF test
I get
0 Wed Feb 26 20:52:42 PST 2003 META-INF/
68 Wed Feb 26 20:52:42 PST 2003 META-INF/MANIFEST.MF
1300 Wed Feb 26 20:12:42 PST 2003 META-INF/autodate.tld
0 Wed Feb 26 20:12:42 PST 2003 test/
5772 Wed Feb 26 20:12:42 PST 2003 test/autodate.class
The latter is a valid archive that I can use for taglib deployment. The former, i.e the Jdev deployed archive does not work. The jsp does not find the tag library.
What is the archiving tool that jdeveloper uses??
Why is it different from doing a command line archive??
Is there anyway I can instruct the deployment tool to include the directory tree in the archive??
- ManishHi Lynn,
The Archive looks exactly the same and the jsp fails to find the tld from the classpath.
64 Fri Apr 04 13:53:48 PST 2000 META-INF/MANIFEST.MF
1300 Fri Apr 04 13:36:48 PST 2000 META-INF/autodate.tld
5772 Fri Apr 04 13:42:48 PST 2000 test/autodate.class
Note, this is a problem only when using the Tag lib autodiscovery mechanism of JSP 1.2 where the tld can exist anywhere in the classpath under META-INF and the path is not explicitly specified in the jsp.
- Manish
- Manish -
Name of an int ( e.g. java.sql.Types )
I have the sql.Types code as an int number and want to display the name. Is there a straightforward method or do I have to search it in a loop like here ?
String getName(int i) {
for (Field f: java.sql.Types.class.getFields()) {
if (f.getType().equals(int.class)) {
if (f.getInt(f.getType()) == i) {
System.out.println( i + " = "+f.getName() );
// e.g. 8 = DOUBLE
return f.getName();
}This question is not specific to java.sql.Types I guess (that's why I post here).
A dedicated hint for sql is appreciated as well, however ;)Seems the loop is required and it works (in no time, there aren't too many Fields)
if (f.getInt(f.getType()) == i) {Having a closer look, I do not understand the inner f.getType() , however.
f.getInt() requires an object, but anything, including null, works ?!
Any hint, or link where to learn about java.lang.reflect.Field, please ? -
SetNull(2, java.sql.Types.DATE);
If I use setNull(1, java.sql.Types.DATE); function, it will insert null on my table's column.
I want to select the date from another table and insert into my table's column, what should I do?
I am sure I cannot call setNull(1,java.sql.Types.DATE), it will insert NULL in my column.
Thanks in advance.Hi,
I think you will be better of in asking ths question in Java forum or Oracle Developer forum.
Regards -
Java.sql.Types.RAW
I know you can map a LONG RAW sql type to the java class oracle.sql.RAW when wrapping the java code in your pl/sql wrapper. The problem I am having is that within my java code I am returning result set and using reslutSetMetaData to determine if the column is a varchar or clob with a switch statment and a case comparison using java.sql.Types.whatever sql type i am looking for. I am running into a problem when trying to write a case statement for long raw columns. What would be the statement to use for this. Below is an example of the code.
int type = rsmd.getColumnType(1);
switch (type) {
case java.sql.Types.CLOB:
code to execute when CLOB type
break;
case java.sql.Types.Raw:
code to execute when LONG RAW type
break;
Thanks in advance,
Kevin
nulluser1330140 wrote:
...the return type which is defined inside DBMS_XDB_VERSION package
I think there are some threads somewhere that points to Oracle documentation somewhere that says that is not possible with JDBC.
I could certainly be mistaken however.
If I am not mistaken then you would need to
1. Wrap the call to that in another proc.
2. That proc extracts the result into something that is visible in the jdbc driver. -
Java.sql.Types.CLOB not returned
When I run the following on an oracle 8.1.7 server using thin/OCI driver on a table with a CLOB column,
DatabaseMetaData dbmd = conn.getMetaData();
ResultSet rs = dbmd.getColumns( null, null, tableName, "%" );
while (rs.next()){
int colType = (int)rs.getShort(5);
I dont get java.sql.Types.CLOB returned in colType, instead I get java.sql.Types.OTHER.
However, after a query on the same table, the result set metadata.getColumnType() returns java.sql.Types.CLOB.
Any ideas?
Thanks in advanceYou can't do that. You can't do it in SQL either: there's no way to call a stored procedure without providing parameters of a specific type.
There are two things you can do, however: one is to declare the parameter as VARCHAR and hope it's not a BLOB or something that the db will not automatically convert to VARCHAR and the other is to do a SELECT in the procedure you are calling instead of returning the value as an output parameter. The second option is better in that you can then use ResultSet.getObject() from Java and obtain the correct object type, not a String you might need to parse afterwards.
Alin.
Maybe you are looking for
-
Can I use an external bluetooth adaptor instead of the internal one?
HI Folks, I need some better range for some bluetooth to serial adaptors so I purchased a class 2 (or was it class 1? memory fading but the higher output one) USB bluetooth dongle which advertised as being Mac compatible. Unfortunately when I plug th
-
Interlaced frames after using Apple directions for Canon HV30 24p
I have an Canon HV30 HDV video camera and clips that have been recorded using its 24p mode. I'm using the instruction Apple has given to remedy this type of footage in Compressor and output to Pro Res: http://support.apple.com/kb/HT2410?viewlocale=en
-
Why does Windows 7 not show up in System Preference's "Startup Disk"
Why does Windows 7, installed via Boot Camp, show up when you hold down the option key when booting but the drive does not show up in System Preferences under the Startup Disk icon. As an aside Windows 7 runs perfectly on my MacBook. - Mike
-
I want to build textures both for building structures, and clothing for a game I play online,, I have photoshop cc, no apps,, what would be the best app to purchase and use?
-
Package won't work - how to make one myself?
After installing and upgrading Arch on my laptop, I wanted to add a battery monitoring application, kpoowersave (since I installed kdebase). Noticed that it is not in pacman's repository. Installed yaourt and found it in AUR. Unfortunately for me, bo