java-stored-procedures

Confusion over class resolution in Oracle java stored procedures

I'm trying to use a third-party java library within oracle. The library seems compatible with the same 1.4 version of the jvm that our Oracle 10g server hosts, since it runs fine outside of Oracle, so I feel like I should be able to get this to work. This library ends up making SOAP-based http requests, and I get class resolution error...

Oracle Java Stored Procedure Command-line Interaction

I have a funny requirement. We need to have a command-line interaction in a Java Stored Procedure. In spite of granting appropriate permissions using the dbms_java.grant_permission commands, I am encountering java.io.IOException, where I read from System.in using java.io.InputStreamReader. Where is the problem? The Java Source is here...

Getting the Return Value from JDBC MSSQL

I'm connecting to SQL Server (2005) through Java using the Microsoft SQL Server JDBC Driver 2.0. How do I get the return value from a stored procedure? I'm doing something like: Connection connection = dataSource.getConnection() CallableStatement proc = connection.prepareCall("{ call dbo.mySproc() }"); proc.execute(); Should I be us...

Export an Oracle database, import it to a different user, stored procedures don't work

I export an oracle "schema" using exp userid=/ file=pt.dmp log=pt.log owner=FOO buffer=10000000 statistics=NONE direct=Y and then import it into a different schema on the same oracle instance on the same SID using imp userid=/ file=pt.dmp fromuser=FOO touser=paul When I try to access the stored procedures with the new user, I get...

How to Call Java Code from MySQL?

I found an article from 2008 discussing how to call Java code from MySQL. There were a lot of caveats and disclaimers because the process involved working with an experimental branch of MySQL. For a project I have in mind, it would be very useful to be be able to access Java libraries within MySQL, analogous to Oracle's Java Stored Proc...

PLS-00103 error when comping Oracle stored function

Given the following Java which is loaded into the database using loadjava: package grassie.example; public class Example { public static String test(){ return "Hello World!"; } } And given the following Oracle Stored Function: CREATE OR REPLACE FUNCTION TEST_FUNCTION RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'grassie.ex...

Clob as param for PL/SQL Java Stored Procedure

I have a java stored procedure that takes in a clob representing a chunk of javascript and mins it. The structure of the function calling the JSP is as follows: function MIN_JS(pcl_js in clob) return clob as language java name 'JSMin.min(oracle.sql.CLOB) return oracle.sql.CLOB'; In the actual JSP, I have the following: import orac...

Java class in DB

Hi! Can anyone explain why was idea to store Java class in Db? What it is good for? And how to create stored procedure with Java class? Best regards! ...

Can anyone say Stored procedures pros and cons AND Java Stored Procedures pros and con?

Hi! Can anyone say Stored procedures pros and cons AND Java Stored Procedures pros and con? And how to test it. Best regards! ...

Java store procedure

I have the following Java store procedure: CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "RetreiveLdap" AS import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Hashtable; import javax.naming.Context; import javax.naming.NamingEnumeration; import j...

Copy image to BLOB from client pc aka Java function in Oracle

Hi guys, I've been stuck with this for past two days. I've go java function stored in Oracle system which is supposed to copy image from local drive do remote database and store it in BLOB - it's called CopyBLOB and looks like this: import java.sql.*; import oracle.sql.*; import java.io.*; public class CopyBLOB { static int ...

JDK 6: Is there a way to run a new java process that executes the main method of a specified class

Hi I'm trying to develop an application that just before quit has to run a new daemon process to execute the main method of a class. I require that after the main application quits the daemon process must still be in execution. It is a Java Stored Procedure running on Oracle DB so I can't use Runtime.exec because I can't locate the ja...

Java stored procedures as Java / .Net interop

I'm looking for a way to access a Java API from both a Java console application and an ASP.Net application. In short my Java API exposes a series of methods for dealing with invoices. All of these methods are essentially commands e.g. GenerateAllInvocies GenerateInvoiceNumber PrintAllInvoices PrintInvoiceNumber All methods will inte...

Calling stored JavaScript function in MongoDB from PHP

I have this function stored in db.system.js function SomeFunc(o) { x = db.Collection; while( 1 ) { var c = x.find({},{_id:1}).sort({_id:-1}).limit(1); var i = c.hasNext() ? c.next()._id + 1 : 1; o._id = i; x.insert(o); var err = db.getLastErrorObj(); if( err && err.code ) { ...