Results 1 to 20 of 20
Thread: Call Java Method in MS SQL
- 02-16-2010, 08:40 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 5
- Rep Power
- 0
- 02-16-2010, 08:42 AM #2
Please explain some more.Your question is not clear.Did u mean database calls via java?
Ramya:cool:
- 02-16-2010, 09:07 AM #3
Member
- Join Date
- Feb 2010
- Posts
- 5
- Rep Power
- 0
I mean, calling a java method that resides in ms sql database. I want to put my java classes in the database and be able to invoke the methods in the database and vice versa.
- 02-16-2010, 09:37 AM #4
I think u are talking about jdbc...Do u want to perform any database operations from java?
Ramya:cool:
- 02-16-2010, 09:51 AM #5
Member
- Join Date
- Feb 2010
- Posts
- 5
- Rep Power
- 0
I am able to connect to database from java through jdbc. How about from database to java? Is there such a thing like that in ms sql? Is there a way to put all my java methods as ms sql database package?
Ohh no.. sorry if I can't get my query clear for you. In Oracle, there is a support in developing, storing and deploying Java applications. I want to know if ms sql has that support also for java. Thank you so much :)
- 02-16-2010, 11:44 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Nope.
That was easy...
Oracle has a Java engine inside it, MS SQL does not.
- 02-16-2010, 12:24 PM #7
Member
- Join Date
- Feb 2010
- Posts
- 5
- Rep Power
- 0
Thanks for the replies.
So, there is also no way to store Java methods or classes to MS SQL database?Last edited by mexyz; 02-16-2010 at 12:29 PM.
- 02-16-2010, 12:38 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Well, I suppose you could store them in there, but what you'd do with them I don't know.
- 02-16-2010, 01:00 PM #9
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
There is a Thread on this forum with full example of
storing java object into Oracle DB:
How to insert java Object in oracle database
So it is serialization story, but what everybody here want to know is
what is purpose of your question
and what are you trying to do with Java and MS SQL?
What kind of methods you plan to store there, why and what is purpose
of calling them in that way.
If you answer this i'm sure many will try to help including me ;)
- 02-16-2010, 01:11 PM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Oracle has a built in Java engine, so you can write Java classes/methods and compile them into Oracle itself, allowing you to call them as though they were stored procedures. The OP is asking if you can do the same in MS SQL.
And now wants to know if you can save classes (not serilialized objects) in MS SQL. For what purpose I don't know, since they won't be able to run them...
- 02-16-2010, 02:10 PM #11
I don't think MS SQL has that built in java engine.I have to explore more to confirm u.
I think our moderators can confirm.Ramya:cool:
- 02-16-2010, 02:57 PM #12
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
No, it doesn't.
- 02-17-2010, 01:32 AM #13
Member
- Join Date
- Feb 2010
- Posts
- 5
- Rep Power
- 0
Yes, I want to store Java classes in MS SQL Server and execute them within the database.
@Tolls: "...since they won't be able to run them..." -> MS SQL won't be able to run the classes because it doesn't have Java engine, am I right?
- 02-17-2010, 09:09 AM #14
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Yes.
The only db I am aware of that contains a JVM is Oracle.
That is, a JVM which will run Java stuff as though they were stored procedures.
Oracle fluffs about with them and sticks a PL/SQL front end on them.
- 02-17-2010, 09:31 AM #15
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
SQL Server stored procedures can call COM objects which can call Java. That approach is probably very painful to implement in a portable manner.
The latest versions of SQL Server have the .NET framework runtime. This means you can write stored procedures in any managed .NET language. That is probably a better route to go.
DB2 also supports Java stored procedures.
- 02-17-2010, 09:39 AM #16
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
db2 does?
Surprises me a bit.
- 02-17-2010, 09:59 AM #17
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You can define so called external stored procedures in quite a few languages actually (including some M$ languages).
Postgres also supports Java, Perl,Python,C++ ...
- 02-17-2010, 10:00 AM #18
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You can define so called external stored procedures in quite a few languages actually (including some M$ languages).
Postgres also supports Java, Perl,Python,C++ ...
- 02-17-2010, 10:05 AM #19
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Ah, that's not quite the same beast.
Oracle stores it all internally, which is what I think this chap is after.
You're not making any external calls at all.
Postgres, for example, isn't running the Java as part of the db.
- 02-17-2010, 01:38 PM #20
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
Similar Threads
-
how to call method?
By leapinlizard in forum New To JavaReplies: 9Last Post: 04-29-2009, 11:55 PM -
Call java method from jsp
By saiphani723 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-25-2009, 11:21 AM -
How to call method in servet by using JSP?
By frankjava1 in forum Java ServletReplies: 2Last Post: 10-24-2008, 04:20 AM -
Call Java Method
By hussainzim in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 05-15-2008, 07:22 AM -
cannot call private method from static method
By jon80 in forum New To JavaReplies: 3Last Post: 05-07-2008, 08:37 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks