Questions tagged [java-stored-procedures]

A subroutine stored in a relational database system written in the Java programming language

Some relational database management systems support Java stored procedures in addition to stored procedures written in a procedural language.

This way stored procedures can be ported better between different databases, because the procedural languages vary between the database implementations. Java offers object-oriented programming features, and developers do not need to learn another programming language, if they already use Java for their application.

On the other hand, procedural languages might be faster, because they are fully integrated in the database whereas a Java stored procedure possibly requires a context switch from the database process to the process which runs the Java virtual machine.

The term Java stored procedure is somehow misleading, as its normally not restricted to the Java language only. Technically speaking Java virtual machine stored procedures would be better, because other languages/compilers which generate compatible byte code for the Java virtual machine will run as well.

195 questions
15
votes
1 answer

Java Stored Procedure Vs PL/SQL Stored Procedure

In Oracle DBMS, which is better performance, calling a java stored procedure from another pl/sql stored procedure or calling a pl/sql stored procedure from another pl/sql stored procedure. By the way I have a loop in my pl/sql procedure that will…
Khalid Galal
  • 181
  • 1
  • 5
11
votes
5 answers

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…
Rich Apodaca
  • 28,316
  • 16
  • 103
  • 129
9
votes
2 answers

StoredProcedureCall 1x Varchar output 1x Cursor output

My question is maybe a little bit confusing. I have the problem that I'm calling an procedure with StoredProcedureCall from Java e.g.: StoredProcedureCall call = new StoredProcedureCall(); call.setProcedureName("test"); …
Xanne
  • 91
  • 2
7
votes
2 answers

How to include jar files to a Java Stored Procedure in Oracle?

I'm realizing a stored procedure and need now the ability to include jar files to my stored procedure, which do not belong to the standard deployment of the JRE. How can I do this? As I know wasn't it possible with Oracle 9 ... Thanks for help!
Florian Müller
  • 7,448
  • 25
  • 78
  • 120
7
votes
4 answers

java.lang.ArithmeticException when attempting to get connection in Oracle 11.2.0.2.0 (64 bit)

I'm currently working with Java Stored Procedures in Oracle and am seeing some strange behaviour when attempting to get a connection within my Java code. My Java is packaged up into a jar file and then deployed into Oracle using the loadjava command…
jabclab
  • 14,786
  • 5
  • 54
  • 51
6
votes
1 answer

Call Oracle Stored procedure from JDBC with complex Input and Output type

I'm so close in solving this question but I'm apparently missing something. My requirement is to call a stored procedure in Oracle from JDBC. The stored procedure takes 1 user-defined Oracle object as INput and another user-defined Oracle object as…
6
votes
3 answers

Update Statement in mysql procedure in not working

Here is my procedure code. I am trying to update Username by putting old username in where clause.but it doesn't work. DELIMITER $$ DROP PROCEDURE IF EXISTS `databasename`.`UpdateUsername` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE…
naveed
  • 75
  • 1
  • 2
  • 9
5
votes
1 answer

java user defined function in oracle using byte[]

Given this table in Oracle create table test (bytes raw(100), chset varchar2(50)) insert into test (bytes, chset) values (hextoraw('454647'), 'iso-8859-1') or in MSSQL create table test (bytes varbinary(100), chset nvarchar(50)) insert into test…
gordy
  • 9,360
  • 1
  • 31
  • 43
5
votes
0 answers

How to call simple select Procedure that using Multiple tables from MySQL using JPA

I have a stored procedure that is returning results from multiple tables CREATE DEFINER=`root`@`localhost` PROCEDURE `GetProjectAndClientOverview`() BEGIN SELECT ( SELECT count(*) FROM projects_info) as "projects_done", (SELECT COUNT(*) FROM…
VJain
  • 1,027
  • 7
  • 17
  • 37
5
votes
2 answers

Spring JDBCTemplate Stored Procedure with ResultSet and OutPut Parameter

I created a stored procedure which returns result rows and two output parameters. I am unable to find any thing in spring from which i can get ResultSet and outPutParameters. I want to achieve something like this using Spring framework.
4
votes
1 answer

Javascript Procedure to create tables in Snowflake

I have tried below code to create tables that listed in tables array, but i get error: JavaScript compilation error: Uncaught SyntaxError: Unexpected end of input in CREATE_TABLES_SP at ' CREATE OR REPLACE PROCEDURE create_tables_sp() …
npool
  • 111
  • 1
  • 1
  • 7
4
votes
1 answer

SnowFlake Stored Procedure Multi Threading

Being new to Snowflake I am trying to understand how to write JavaScript based Stored Procedures (SP) to take advantage of multi-thread/parallel processing. My background is SQL Server and writing SP, taking advantage of performance feature such as …
4
votes
0 answers

Register parameter for "inout cursor" type using Spring JDBCTemplet/StoredProcedure

I have a requirement to call an oracle procedure using SpringJDBC Template. I was able to call several procedure that had IN or OUT parameters. But, recently, I got requirement to write a "Spring DAO procedure" that has one attribute of "INOUT" and…
yeppe
  • 679
  • 1
  • 11
  • 43
4
votes
1 answer

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; …
amirka
  • 313
  • 2
  • 12
4
votes
2 answers

Spring JcbcTemplate to call Oracle Stored Proc. Spring 3.2

I have some straight JDBC code using a CallableStatement working. I have been trying to convert it to Spring leveraging the DataSource, JdbcTemplate and SimpleJdbcCall. I have tried basically every tutorial, example and snippets from the Spring docs…
user3596751
  • 163
  • 1
  • 2
  • 5
1
2 3
12 13