By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,708 Members | 2,080 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,708 IT Pros & Developers. It's quick & easy.

MySQL Gets Functions in Java - Enlightenment Please

P: n/a
Can someone a little more clever than I (which means just about anyone
on this list) tell me what the implications/benefits are of this are
please?

http://developers.slashdot.org/devel...id=156&tid=198

Cheers

T.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
It means that you can create stored procedures/functions which reside in
the database that are written in java (as opposed to the native SQL
programming language).

Why would you want this? If you were more familiar with java than any of
the currently supported procedural languages, then it means that you don't
necessarily have to get to grips with another programming language.

This would be a "nice to have" for Postgres too - I believe that it
supports PL/pgSQL, PL/Tcl, PL/Perl, and PL/Python at present.

Oracle also offers the ability to write stored procedures in java.

It's funny, even though I program in java all the time, I still write my
procedures in the SQL programming language (PL/pgSQL). Even if the java
language were available for Postgres, I'm not sure I would use it...

John Sidney-Woollett

Tony (Unihost) said:
Can someone a little more clever than I (which means just about anyone
on this list) tell me what the implications/benefits are of this are
please?

http://developers.slashdot.org/devel...id=156&tid=198

Cheers

T.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #2

P: n/a
Does this include ALL the functionality of Java? Objects, Polymorphism,
Inheritance, or is it just a subset?

T.
John Sidney-Woollett wrote:
It means that you can create stored procedures/functions which reside in
the database that are written in java (as opposed to the native SQL
programming language).

Why would you want this? If you were more familiar with java than any of
the currently supported procedural languages, then it means that you don't
necessarily have to get to grips with another programming language.

This would be a "nice to have" for Postgres too - I believe that it
supports PL/pgSQL, PL/Tcl, PL/Perl, and PL/Python at present.

Oracle also offers the ability to write stored procedures in java.

It's funny, even though I program in java all the time, I still write my
procedures in the SQL programming language (PL/pgSQL). Even if the java
language were available for Postgres, I'm not sure I would use it...

John Sidney-Woollett

Tony (Unihost) said:

Can someone a little more clever than I (which means just about anyone
on this list) tell me what the implications/benefits are of this are
please?

http://developers.slashdot.org/devel...id=156&tid=198

Cheers

T.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Nov 12 '05 #3

P: n/a
Sorry but I don't know what would be supported. Perhaps someone else can
provide more info.

Here is a document from Oracle detailing their java stored procedure support:

http://otn.oracle.com/tech/java/jroa...ing.htm#998299

Hope that helps.

John

Tony (Unihost) said:
Does this include ALL the functionality of Java? Objects, Polymorphism,
Inheritance, or is it just a subset?

T.
John Sidney-Woollett wrote:
It means that you can create stored procedures/functions which reside in
the database that are written in java (as opposed to the native SQL
programming language).

Why would you want this? If you were more familiar with java than any of
the currently supported procedural languages, then it means that you
don't
necessarily have to get to grips with another programming language.

This would be a "nice to have" for Postgres too - I believe that it
supports PL/pgSQL, PL/Tcl, PL/Perl, and PL/Python at present.

Oracle also offers the ability to write stored procedures in java.

It's funny, even though I program in java all the time, I still write my
procedures in the SQL programming language (PL/pgSQL). Even if the java
language were available for Postgres, I'm not sure I would use it...

John Sidney-Woollett

Tony (Unihost) said:

Can someone a little more clever than I (which means just about anyone
on this list) tell me what the implications/benefits are of this are
please?

http://developers.slashdot.org/devel...id=156&tid=198

Cheers

T.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #4

P: n/a
On Saturday 20 December 2003 16:44, John Sidney-Woollett wrote:
It means that you can create stored procedures/functions which reside in
the database that are written in java (as opposed to the native SQL
programming language).


Does it mean mysql got stored procedures? Wow..

I would like to see details but since I don't know much details about either
mysql or java, I can not describe it.

Can anybody give a summary as in how much it takes mysql as far as stored
procedures go? That would be great..

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #5

P: n/a
On Saturday 20 December 2003 16:44, John Sidney-Woollett wrote:
This would be a "nice to have" for Postgres too - I believe that it
supports PL/pgSQL, PL/Tcl, PL/Perl, and PL/Python at present.


http://techdocs.postgresql.org/guides/PLLanguages

It is already supported..:-)

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #6

P: n/a
On Sun, 21 Dec 2003 12:05 am, Shridhar Daithankar wrote:
Does it mean mysql got stored procedures? Wow..

I would like to see details but since I don't know much details about
either mysql or java, I can not describe it.

Can anybody give a summary as in how much it takes mysql as far as stored
procedures go? That would be great..

Shridhar


Apparently it's literally a 0.1 release, much of it doesn't work and even tho
a mysql guy is involved its actually a seperate project on sourceforge. You
can use it to effect sub selects and all that jazz but it's not like they've
created some sort of framework for stored procedures.

Essentially they've taken the fact that yes you can extend mysql by writing C
or C++ level functions and creating a custom built server so why not make a
litte generic interface that to do the same thing with java where you dont
need to go thro the rebuild process each time.

Rgds,

Jason
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #7

P: n/a


On Sat, 20 Dec 2003, Tony (Unihost) wrote:
Can someone a little more clever than I (which means just about anyone
on this list) tell me what the implications/benefits are of this are
please?

http://developers.slashdot.org/devel...id=156&tid=198


This is not a real stored procedure language and it doesn't claim to be
despite the messages on this list or slashdot. What it does is allow
regular functions to be written in Java. Not to say this isn't valuable,
but the key to an in database language is the ability to query the
database. Now, it should be possible to open a JDBC connection back to
the database like any other java process, but the problem is that it will
not run in the same transaction as the connection which is calling the
function.

Another thing I noticed about this is the prototype for a function is
String exec(String []). So it's type checking certainly won't be
great. It says (and means) version 0.1 and doesn't (yet) deserve all the
noise it has caused.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #8

P: n/a

On 20/12/2003 13:05 Shridhar Daithankar wrote:
On Saturday 20 December 2003 16:44, John Sidney-Woollett wrote:
It means that you can create stored procedures/functions which reside

in
the database that are written in java (as opposed to the native SQL
programming language).


Does it mean mysql got stored procedures? Wow..


I read it to mean user-defined functions only. Maybe I missed something?

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #9

P: n/a
I'm actually starting to write one of these for postgres, and apparently
there is another one in the works, from Thomas Hallgren.

There is at least one significant architectural issue here to deal with

Is it more desirable to have a single java vm and communicate via RPC,
or some other mechanism? ie sockets, or ? The alternative is to
instantiate a java vm for every connection, this could be onerous as
there would be considerable overhead for each java vm.

This will all go away as soon as java version 1.5 comes out but in the
meantime, what does everyone think

Comments are welcome.

Dave

On Sat, 2003-12-20 at 09:00, Paul Thomas wrote:
On 20/12/2003 13:05 Shridhar Daithankar wrote:
On Saturday 20 December 2003 16:44, John Sidney-Woollett wrote:
It means that you can create stored procedures/functions which reside

in
the database that are written in java (as opposed to the native SQL
programming language).


Does it mean mysql got stored procedures? Wow..


I read it to mean user-defined functions only. Maybe I missed something?

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #10

P: n/a
John Sidney-Woollett wrote:
It means that you can create stored procedures/functions which reside in
the database that are written in java (as opposed to the native SQL
programming language).

Why would you want this? If you were more familiar with java than any of
the currently supported procedural languages, then it means that you don't
necessarily have to get to grips with another programming language.

This would be a "nice to have" for Postgres too - I believe that it
supports PL/pgSQL, PL/Tcl, PL/Perl, and PL/Python at present.

PostgreSQL supports more than just that including:

pl/php
pl/perl
pl/ruby
pl/python
pl/tcl
pl/c
pl/pgsql
pl/r
plr/bash (I think... or was that just pgBash?)

There was an beta (alpha?) of pl/Java at one time...

Personally I would stick with pl/python, pl/php, or pl/perl

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-222-2783 - jd@commandprompt.com - http://www.commandprompt.com
Editor-N-Chief - PostgreSQl.Org - http://www.postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #11

P: n/a
On Sat, 2003-12-20 at 13:04, Dave Cramer wrote:
Is it more desirable to have a single java vm and communicate via RPC,
or some other mechanism? ie sockets, or ? The alternative is to
instantiate a java vm for every connection, this could be onerous as
there would be considerable overhead for each java vm.


If you fire up the jvm at connection creation time rather than at first
pljava function call, wouldn't that make things much simpler and faster
per process? I only ask because I'm thinking most people using pljava
should have some kind of connection pooling going on where initial
connection creation overhead is significantly minimized...

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #12

P: n/a
Robert Treat <xz****@users.sourceforge.net> writes:
On Sat, 2003-12-20 at 13:04, Dave Cramer wrote:
Is it more desirable to have a single java vm and communicate via RPC,
or some other mechanism?
If you fire up the jvm at connection creation time rather than at first
pljava function call, wouldn't that make things much simpler and faster
per process?


You could possibly support both approaches by using the "library preload"
mechanism that Joe Conway developed recently. That is, the DBA can
either:

* Preload pljava, whereupon a JVM is created by the postmaster, and the
connection to this JVM is passed down to each backend and shared by
them.

* Do nothing, whereupon each backend that actually makes any pljava
function calls would have to start a JVM upon its first call.

I could see either of these approaches being the more efficient,
depending on how much pljava work is done in a given installation.
So being able to support both seems attractive.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #13

P: n/a
Dave Cramer wrote:

This will all go away as soon as java version 1.5 comes out but in the
meantime, what does everyone think

Startup time for the jvm is much faster in 1.4.2 than in previous releases.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #14

P: n/a
Dave Cramer wrote:

This will all go away as soon as java version 1.5 comes out but in the
meantime, what does everyone think

Startup time for the jvm is much faster in 1.4.2 than in previous releases.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.