Java and Stored procedure with MS SQL Server


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Java and Stored procedure with MS SQL Server

Hybrid View

  1. #1
    Arnold Guest

    Java and Stored procedure with MS SQL Server


    Hello,
    I know the question is weird, but does anybody have information on how to
    (re)use java code within a SQL Server Stored Procedure. DB2 and Oracle allow
    the creation of stored procedures written in Java.
    The MS strategy is not to promote java but...

  2. #2
    MarkN Guest

    Re: Java and Stored procedure with MS SQL Server


    Which databases have you written Java stored procs for?

    Typically, Stored Procs are database specific no matter the language. I
    would say the only advantage of using Java as the language is that one will
    have one less language to learn. I haven't used Java for the stored proc
    language yet so I can't say for sure. I avoid stored procs and instead have
    my data access code run on the server to gain performance. I do have to
    do a few triggers but those are usually easily transferable and there really
    is no way to avoid them.

    Anyway (getting off my soapbox), depending on what is contained the Java
    - Java can be called via a COM bridge and COM objects can be called from
    SQL Server stored procs. Other than that, I know of no way. Don't consider
    J++ and J#. They are Java in syntax only.

    There might be a different approach depending on what you are doing. I typically
    see things being done in the wrong place and using different techniques and
    technologies usually solves the problem. What are your stored procs doing?

    Mark

    "Arnold" <arnold_lescar@yahoo.fr> wrote:
    >
    >Hello,
    >I know the question is weird, but does anybody have information on how to
    >(re)use java code within a SQL Server Stored Procedure. DB2 and Oracle allow
    >the creation of stored procedures written in Java.
    >The MS strategy is not to promote java but...



  3. #3
    Arnold Guest

    Re: Java and Stored procedure with MS SQL Server


    Well, the context I am in is a little bit complicated.
    I am working on a Client/Server product in which the server part is written
    partly in Cobol.
    The Product has its data stored inside a database : the supported database
    are : the whole DB2 family, Oracle and MS SQL Server. The server part runs
    from OS/390 box, AS/400 to Unix box and Windows box.
    As we are addind some new features in the product, we find quite nice and
    cheap to develop in java instead of cobol. The code is portable and this
    allows us to manages XML and stuff like that.
    It's not possible for us to rewrite the whole product : we have to keep a
    lot of cobol even if, more and more, the new developments are done in Java.
    One of the more portable way of 'calling' java code from cobol I found is
    to use the Java Stored Procedures : it's working well with DB2 and Oracle...but
    it does not exist 'directly' with SQL Server (of course we may use COM but
    I would like to avoid it since it's another world again to go into ...)
    There are many other considerations (the installation of the product must
    be the more standard as possible...).
    By the way, the stored procedures won't be called directly by a client application
    but by the server part. The way the JVM and .class are managed by the 'Database'
    (it's more than a database now !) Engine is quite efficient and the so the
    performance of this kind of architecture is not an issue.
    Well, thanks for your reply. I will consider using COM...

    "MarkN" <java.@127.0.0.1> wrote:
    >
    >Which databases have you written Java stored procs for?
    >
    >Typically, Stored Procs are database specific no matter the language. I
    >would say the only advantage of using Java as the language is that one will
    >have one less language to learn. I haven't used Java for the stored proc
    >language yet so I can't say for sure. I avoid stored procs and instead

    have
    >my data access code run on the server to gain performance. I do have to
    >do a few triggers but those are usually easily transferable and there really
    >is no way to avoid them.
    >
    >Anyway (getting off my soapbox), depending on what is contained the Java
    >- Java can be called via a COM bridge and COM objects can be called from
    >SQL Server stored procs. Other than that, I know of no way. Don't consider
    >J++ and J#. They are Java in syntax only.
    >
    >There might be a different approach depending on what you are doing. I

    typically
    >see things being done in the wrong place and using different techniques

    and
    >technologies usually solves the problem. What are your stored procs doing?
    >
    >Mark
    >
    >"Arnold" <arnold_lescar@yahoo.fr> wrote:
    >>
    >>Hello,
    >>I know the question is weird, but does anybody have information on how

    to
    >>(re)use java code within a SQL Server Stored Procedure. DB2 and Oracle

    allow
    >>the creation of stored procedures written in Java.
    >>The MS strategy is not to promote java but...

    >



  4. #4
    MarkN Guest

    Re: Java and Stored procedure with MS SQL Server


    Sounds like a good idea - like you are using the SPs as a means to an end
    not the means and the end.

    Until MS provides a way to use a real programming language directly in SQL
    Server, COM is the only way. I think the next big release of SQL server
    will allow one to use a .Net language but it might only be C#. But you will
    still have to use a bridge - just not T-SQL and COM and then Java.

    You might ask in the SQL Server news group if anyone knows when a .Net language
    will be available in SQL Server. I wouldn't say why you want to know.

    Unfortunately MS products don't seem to play well with everyone else.

    "Arnold" <arnold_lescar@yahoo.fr> wrote:
    >
    >Well, the context I am in is a little bit complicated.
    >I am working on a Client/Server product in which the server part is written
    >partly in Cobol.
    >The Product has its data stored inside a database : the supported database
    >are : the whole DB2 family, Oracle and MS SQL Server. The server part runs
    >from OS/390 box, AS/400 to Unix box and Windows box.
    >As we are addind some new features in the product, we find quite nice and
    >cheap to develop in java instead of cobol. The code is portable and this
    >allows us to manages XML and stuff like that.
    >It's not possible for us to rewrite the whole product : we have to keep

    a
    >lot of cobol even if, more and more, the new developments are done in Java.
    >One of the more portable way of 'calling' java code from cobol I found is
    >to use the Java Stored Procedures : it's working well with DB2 and Oracle...but
    >it does not exist 'directly' with SQL Server (of course we may use COM but
    >I would like to avoid it since it's another world again to go into ...)
    >There are many other considerations (the installation of the product must
    >be the more standard as possible...).
    >By the way, the stored procedures won't be called directly by a client application
    >but by the server part. The way the JVM and .class are managed by the 'Database'
    >(it's more than a database now !) Engine is quite efficient and the so the
    >performance of this kind of architecture is not an issue.
    >Well, thanks for your reply. I will consider using COM...
    >
    >"MarkN" <java.@127.0.0.1> wrote:
    >>
    >>Which databases have you written Java stored procs for?
    >>
    >>Typically, Stored Procs are database specific no matter the language.

    I
    >>would say the only advantage of using Java as the language is that one

    will
    >>have one less language to learn. I haven't used Java for the stored proc
    >>language yet so I can't say for sure. I avoid stored procs and instead

    >have
    >>my data access code run on the server to gain performance. I do have to
    >>do a few triggers but those are usually easily transferable and there really
    >>is no way to avoid them.
    >>
    >>Anyway (getting off my soapbox), depending on what is contained the Java
    >>- Java can be called via a COM bridge and COM objects can be called from
    >>SQL Server stored procs. Other than that, I know of no way. Don't consider
    >>J++ and J#. They are Java in syntax only.
    >>
    >>There might be a different approach depending on what you are doing. I

    >typically
    >>see things being done in the wrong place and using different techniques

    >and
    >>technologies usually solves the problem. What are your stored procs doing?
    >>
    >>Mark
    >>
    >>"Arnold" <arnold_lescar@yahoo.fr> wrote:
    >>>
    >>>Hello,
    >>>I know the question is weird, but does anybody have information on how

    >to
    >>>(re)use java code within a SQL Server Stored Procedure. DB2 and Oracle

    >allow
    >>>the creation of stored procedures written in Java.
    >>>The MS strategy is not to promote java but...

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center