Are there different methods to call Java from Oracle Application Express - java

Friends,
I'm working on a requirement where I need to call a Java API from Apex.
The solution I put forward was to create a Java class, store it the database and add a PL/SQL wrapper and then use it. Which is pretty much what is described here.
Whilst I am happy with this, I am interested to know if this is the only method? are there other options that I could explore?
Thanks in advance

From what I've seen, APEX doesn't have anything special for calling Java Stored Procedures.
So it's the same thing as calling a Java SP from within PL/SQL.
As can be seen here there is no other way of doing it beside the one you use now.
I would just add that what you actually call a wrapper is in fact the way a Java SP is published to the data dictionary(it makes it available to the SQL/PLSQL contexts). In your case you do it by defining a top-level call specification. Alternatively you can publish it by defining either a package or an object type call specification. For more details see this link.

Related

Evernote: Get a list of all edits

I am trying to develop a simple statistics tool to analyse various behaviours of collaborators within an Evernote Notebook using the Evernote Java API.
I need the informations which user edited which note and when.
Even though the documentation is quite good, I am still unable to find the required functionality inside the api.
(TLDR:)
Is there a way to access a list of edits of a evernote note using the API?
I am not bound to using the Java SDK so if there is a way, which is limited to using another language, it would be no problem to switch.
Andreas - Did you look into these methods in the API?
NoteStore.GetNote and NoteStore.getNoteApplicationData
It sounds like this would be a decent place to start at the very least. I cannot say for certain if this will return everything you are looking for though.
I hope this helps!
I'm not exactly sure what you are looking for but NoteStore#listNoteVersions might be the one you want. You can get a list of NoteVersionId and then use another API called NoteStore#getNoteVersion to get metadata to see which note is updated when.
Note that the API is probably only for premium accounts.

How to analyze method calls and objects of other classes used in a java class programmatically

i need to detect if a class relies on another class programatically,to detect inappropriate intimacy code smell(i want to analyze other java programs ,using my program).Any directions on
how to achieve this will be a great help.
And
How to identify all the objects created in a java program?
How to identify all the called methods in a java program?
Any help would be appreciated.
You might want to use what's already there instead of building something yourself. Especially if you're not very familiar with the internals of Java and the JVM.
Have a look at JDepend: http://clarkware.com/software/JDepend.html
Use a profiler as JConsole or VisualVM. With the use of profilers you can pretty much see everything that happens at runtime.
One way i think of is using logger, Put some log statement in the construct and in the methods you want to monitor. So through logs you can find out the objects created and methods accessed
I have found very useful the ObjectWeb asm-all Java bytecode manipulation and analysis library, also known as asm-all.jar
It allows you to convert any *.jar application into equivalent XML file. You can fully inspect the application structure, change it in the XML format and convert back into *.jar file
In order to use the XML files you'll need to understand what it contains. Oracle's The Java® Virtual Machine Specification is very good reference to start with
BTW: one thing you can do with this tool is to instrument the bytecode so that it creates runtime profiling information - which methods were called and by whom (as suggested by #upog)

Providing a Java Programm as (D)COM Service

I am looking for a solution (best example code) how to implement an register a Java Program as (D)COM Server/Service. More concise I have the following issue:
Initially situation is:
(a) I have a Java Webservice (Axis) pulling in Data from the Web.
(b) I have a 3rd Party service (written in Delphi) which wants the
data from a COM-Object and is periodically calling this (the
interface, which methods of the COM Object are called, is specified).
In order to get the data from (a) to (b), I need to implement a COM-Server which provids the needed methods for (b) to retrieve its data.
The main Question I have is:
How can I make and register the Java Service as a COM-Object and provide the needed methods so that (b) get its data when calling.
I know Java, but I am no expert to (D)COM. So, forgive me possible technical error concerning COM.
Searching the Web I found several tools/frameworks (e.g. JInterop) that allow a Java Program to interact with a COM-Object, but I did not found code etc. how to make a Java Program accessible via (D)COM.
First, take a look on using Java Servers and DCOM. An example is idl server. Also, you can see services tutorial.

using python class methods inside java

I have three different classes written in python. They contain several methods which I want to use them inside my java program (creating objects from these python classes and use these objects to call the methods). Actually my level in java might be intermediate. However, i am absolutely new in python. I have read that it is possible to use Python class methods inside java but there is no clear way that is well explained. So, please help me with a script or a tutorial or any advice that can help understanding using python classes methods in java.
Jython is the way to go. If you have a couple of hours I would recommend you go over the tutorial for it.
If you are curious to see how jython can be used inside java skip to:
http://wiki.python.org/jython/LearningJython#integrating-jython-python-into-java

Netbeans and .NET web services

I'm not an experienced java developer so any comment will be welcomed ...
I've written a web service using c# and I wanted to consume this service from java - used Netbeans for this task.
All methods works well beside one: the method expecting a type called BusinessDataField2 - this type contains 2 fields: name(string) and value(object)
Those fields are filled using get,set methods - this works easily at the .NET environment.
However ...
I can see that Java requires different parameters for the get and set methods - the parameter is :
JAXBElement
JAXBElement
The question is: how do I instantiate this object? I tried many different ways but nothing worked...
Thanks,
ofer
You should not use the "object" type. It could be any actual type, but you're not telling the Java side what to expect. The best it can do, then, is process the actual XML of the value.
Consider: the object could be an int, or it could be some complex structure. How would the Java side know what to do with it? The Java side wouldn't even have a proxy classs for the complex structure, because you never told it that you could ever return the complex structure.
I'd recommend using the CXF web service framework to consume your web service. It can look at your wsdl file and generate java objects that correspond to your .net objects.
They have a HOWTO on their site as well.

Categories