How does Java fit into PL/SQL-Oracle? [message #402445] |
Sun, 10 May 2009 09:29  |
JenFromNY
Messages: 10 Registered: May 2009
|
Junior Member |
|
|
I know this is a vague but I only have limited information and I was hoping someone here could help me. I am somewhat familiar with PL/SQL and I know a bit of Java programming but I've never used them together. I understand that in Oracle databases, Java may be used in conjunction with PL/SQL -- perhaps Java might be used to display/trigger some error/output related to a botched database insert?. But how exactly is does the Java language work with Oracle and PL/SQL? And is it the normal Java programming language or Javascript that is used? Could someone please give me a quick and simple overview or provide a link to a tutorial? A few simple sets of Java/Oracle-PL/SQL instructions and commands would be greatly appreciated. Thx.
|
|
|
|
|
More help please on "How does Java fit into PL/SQL-Oracle?" [message #402553 is a reply to message #402445] |
Mon, 11 May 2009 08:02   |
JenFromNY
Messages: 10 Registered: May 2009
|
Junior Member |
|
|
Sorry but not all of the links provided in your replies were unbroken or understandable to me...a novice. I am not a developer, just someone who will interact with an Oracle database in a very basic way to run some select queries and to get the details when, say, a file with invalid characters comes and triggers an error. Somehow Java is used to output this error so the bad file can be detected and rectified...I believe a stcktrace of some kind might be inviolved. This is where I need some very basic guidance. Java, as I have dealt with it in the past, requires its code to be compiled via javac. Would you really need to compile your code every time you use Java within an Oracle database for issues such as the one I described above? This doesn't seem right to me. Could it be a Javascript of some kind that is used? Is there anyone who can step thru, in a very basic way, what the process would be? Thx.
[Updated on: Mon, 11 May 2009 08:59] Report message to a moderator
|
|
|
Re: More help please on "How does Java fit into PL/SQL-Oracle?" [message #402580 is a reply to message #402553] |
Mon, 11 May 2009 10:11   |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Basically there could be 2 completely different scenarios:
1) There could be a separate Java program that is interacting with the DB via the JDBC driver, and that is generating the errors you see, or ...
2) there could be Java stored procedures INSIDE the Oracle database which are generating the errors you see.
Those would be two completely different things, which would require completely different approaches.
Can you find out which one of the two is the case in your system?
|
|
|
Re: More help please on "How does Java fit into PL/SQL-Oracle?" [message #402590 is a reply to message #402580] |
Mon, 11 May 2009 10:39   |
JenFromNY
Messages: 10 Registered: May 2009
|
Junior Member |
|
|
I really can't say. All I know is that when a third party sends their data file to "us", it can generate an error if the file contains invalid characters. Somehow, some way, JAVA is used by us to see the error and, I assume, determine what/where the bad character is. An Oracle DB with PL/SQL is involved. I just don't want to walk into this issue totally clueless...just need enough info to get started on learning the basics. Is there a way with Java you can submit an uncompiled command to see a stack trace or error log?...I'm guessing this is more or less what may be involved here. But I'm totally guessing because I have never been exposed to this before.
|
|
|
Re: More help please on "How does Java fit into PL/SQL-Oracle?" [message #402604 is a reply to message #402590] |
Mon, 11 May 2009 11:02   |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
In both scenarios you can't send any un-compiled Java commands.
There is either compiled Java bytecode on the filesystem, or compiled Java bytecode in the Oracle stored Java procedure.
You CAN send un-compiled PL/SQL Code from an external Java program to be executed on the database on the other hand.
But, as I said 1) and 2) would be basically two different cases, so it would also be two completely different basics you would have to start learning. So better find out which case it it, first.
A possible starting point for case 1 would be here
A possible starting point for case 2 would be here, especially the "Java Stored Procedure" example.
|
|
|
|