Stored Procedures and java

Stored Procedures and java

Post by Arnold F » Wed, 03 Jul 2002 18:40:11



Hello,
I was wondering if it's planned to be able to use java as a coding
language for creating stored procedures. It's possible to do that in
IBM UDB/DB2 and Oracle.
If it's not something realistic in the MS SQLServer world, how do I
reuse some java code inside a stored procedure ? is there a way to do
that so as not to load the JVM each time the SP is called ?
Thanks in advance for your comments and help
Bye
 
 
 

Stored Procedures and java

Post by Erland Sommarsko » Wed, 03 Jul 2002 20:33:44



> I was wondering if it's planned to be able to use java as a coding
> language for creating stored procedures. It's possible to do that in
> IBM UDB/DB2 and Oracle.
> If it's not something realistic in the MS SQLServer world, how do I
> reuse some java code inside a stored procedure ? is there a way to do
> that so as not to load the JVM each time the SP is called ?
> Thanks in advance for your comments and help

No, you cannot use Java directly in a stored procedure. Microsoft has
announced that in the next version of SQL Server you will be able to
use languages such as Visual Basic in stored procedures. Whether Java
is on that list, I don't know.

If you want to call code written in other languages, you can either write
an extented stored procedure, or use the sp_OAxxxx routines to call a
COM object. Again, I don't know whether Java lends itself to this.

--
Erland Sommarskog, SQL Server MVP

Books Online (updated!) for SQL 2000 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 
 
 

Stored Procedures and java

Post by patrice caste » Wed, 03 Jul 2002 23:32:40


I'm afraid Java will never be inside a Microsoft product, as it comes from
Sun, their enemy, and they even announce than in next Windows release Java
won't be able to run ...
It's their way to promote .NET : do what I want or what I want, or die ...
Too bad ...




> > I was wondering if it's planned to be able to use java as a coding
> > language for creating stored procedures. It's possible to do that in
> > IBM UDB/DB2 and Oracle.
> > If it's not something realistic in the MS SQLServer world, how do I
> > reuse some java code inside a stored procedure ? is there a way to do
> > that so as not to load the JVM each time the SP is called ?
> > Thanks in advance for your comments and help

> No, you cannot use Java directly in a stored procedure. Microsoft has
> announced that in the next version of SQL Server you will be able to
> use languages such as Visual Basic in stored procedures. Whether Java
> is on that list, I don't know.

> If you want to call code written in other languages, you can either write
> an extented stored procedure, or use the sp_OAxxxx routines to call a
> COM object. Again, I don't know whether Java lends itself to this.

> --
> Erland Sommarskog, SQL Server MVP

> Books Online (updated!) for SQL 2000 at
> http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 
 
 

Stored Procedures and java

Post by Luc » Thu, 04 Jul 2002 08:32:14


That's an absolutely inaccurate twisted story (especially the the last
sentence). If there will be 3rd party vendors support Java for .NET I don't
see why in the next SQL release you couldn't use Java.


> I'm afraid Java will never be inside a Microsoft product, as it comes from
> Sun, their enemy, and they even announce than in next Windows release Java
> won't be able to run ...
> It's their way to promote .NET : do what I want or what I want, or die ...
> Too bad ...




> > > I was wondering if it's planned to be able to use java as a coding
> > > language for creating stored procedures. It's possible to do that in
> > > IBM UDB/DB2 and Oracle.
> > > If it's not something realistic in the MS SQLServer world, how do I
> > > reuse some java code inside a stored procedure ? is there a way to do
> > > that so as not to load the JVM each time the SP is called ?
> > > Thanks in advance for your comments and help

> > No, you cannot use Java directly in a stored procedure. Microsoft has
> > announced that in the next version of SQL Server you will be able to
> > use languages such as Visual Basic in stored procedures. Whether Java
> > is on that list, I don't know.

> > If you want to call code written in other languages, you can either
write
> > an extented stored procedure, or use the sp_OAxxxx routines to call a
> > COM object. Again, I don't know whether Java lends itself to this.

> > --
> > Erland Sommarskog, SQL Server MVP

> > Books Online (updated!) for SQL 2000 at
> > http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 
 
 

1. Calling a stored procedure in java

hi NG,

following Problem: i have a MS SQL Server procedure, which starts like this:


  [...]

The procedure works fine. Now I try to run it in java. The corresponding code looks like this:

  CallableStatement cstmt = con.prepareCall("{call seq_currval(?, ?)}");
  cstmt.setString(1, "testseq_01");
  cstmt.registerOutParameter(2, Types.INTEGER);
  cstmt.execute();
  int retVal = cstmt.getInt(2);

after compiling and execution i get a sql exception:

[SQLServer]There are too much arguments for the procedure or funtion 'seq_currval'.
(actually i get a german message, so its probably not the exact english match)

does anyone has a suggestion?

thanks,
Lars

2. Importing databases (Dave)

3. Problem with ms-sqlserver stored procedure using Java

4. Trigger Event for WM_PAINT

5. SQLServer 7.0: Triggers and Stored Procedures in JAVA ?

6. SP4 installation error

7. Compile Stored procedure from Java

8. cperf in ESQL/C 5.0

9. Problem committing updates upon calling host stored procedure from Java app on AS400

10. PASSING RECORD TYPE PARAMETERS TO STORED PROCEDURE WITH JAVA

11. calling SQL Server stored procedure from Java

12. accessing stored procedure from java

13. Calling a Stored Procedure from Java Code