Slashdot Mirror


MySQL Gets Functions in Java

Java Coward writes "Eric Herman and MySQL's Brian "Krow" Aker have released code to allow the DBMS MySQL to run Java natively inside of the database. The code allows users to write functions inside of the database that can be then used in SELECT/INSERT/UPDATE statements. So when will someone do Ruby?"

20 of 318 comments (clear)

  1. Hmmmm by cluge · · Score: 4, Insightful

    I wonder how this affects performance especially compared to regular user defined functions? (Available in later releases of MySQL). This is indeed an interesting twist. It certainly can help speed up development of large projects (java works well in a large/many programmer env.) Like a lot of other tools, it remains to be seen how people put this to use. Too often people learn one thing, and like the saying goes, when all you have is a hammer, every problem looks like a nail. Lets see where this goes shall we?

    --
    "Science is about ego as much as it is about discovery and truth " - I said it, so sue me.
  2. My bad by GillBates0 · · Score: 3, Insightful

    The above interface allows you to use MySQL via Ruby. What's required here is the converse.

    --
    An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
  3. Re:Keep this out. by gustgr · · Score: 4, Insightful

    I don't know why everybody wants to keep distance from Java. It is a very nice language implementing the very well the OOP paradigm.

    The 'lusers' may not use this new feature but Java programmers will and hopefully will enjoy it.

  4. Sounds like... by AndroidCat · · Score: 3, Insightful
    More code to bog down the servers with. I don't know if I see the need for Java inside the DB server. (Sure, server Java between the DB and the client app, but that doesn't require Java inside the DB server itself.)

    I hope this isn't a "Hey wouldn't it be really neat!" feature. The last time that happened, someone at MS thought executable email would really neat.

    --
    One line blog. I hear that they're called Twitters now.
    1. Re:Sounds like... by the+uNF+cola · · Score: 5, Insightful

      We all don't like learning the database language of a database. It's annoying that oracle, sybase, postgresql and mysql support different sets of ansi92 (or 98) sql, but they all have different gotchas..

      limiting the # of rows of output is different between oracle, sybase and postresql/mysql.

      None of them even have remotely the same stored proc language. Of course, everyone may embed a different language, but java seems to be a more common one.

      Now when you go from sybase to oracle, you don't have to worry so much about the stored procedure code, since it'd all be in java anyway.. riight?

      --

      --
      "I'm not bright. Big words confuse me. But Wanda loves me and that should be enough for you." - Cosmo

    2. Re:Sounds like... by GreggBert · · Score: 2, Insightful

      Agreed, however, some of the open source and "developer source" software that I think might be useful to us in the future in our workplace only works with MySql, out of the box. That and the fact that up until recently, PG was not available on Windows which, unfortunately, is one of our production platforms.

      --


      If you don't understand anything I post, please accept that I ate paste as a small boy...
  5. That's great by j0hndoe · · Score: 5, Insightful

    I used Java stored procedures a lot back when I was working at a .com. For someone who's already using Java its a lot easier than learning each database vendors proprietary language. It's also good for keeping MySQL feature competitive with open source dbs, since Java stored prcedures have already been implemented for PostgreSQL

    1. Re:That's great by Brento · · Score: 2, Insightful

      I used Java stored procedures a lot back when I was...

      Just FYI - MySQL still doesn't support stored procedures, let alone Java inside stored procedures. Seems like MySQL is trying to run before it's gotten the walking thing down yet.

      --
      What's your damage, Heather?
  6. Re:Keep this out. by j3110 · · Score: 4, Insightful

    Did you not think about that post? Sounds like you just dislike Java so much that hearing it in the same sentance as MySQL makes you cringe.

    1) Java isn't going to slow down any queries unless you use Java functions.
    2) What do you care that someone else isn't smart enough to write good software?
    3) MySQL as it stands has no other way to really embed functions easily, and it's actually more effecient to run code on the server and transfer data back afterwords.

    --
    Karma Clown
  7. Java in the DB - very, very bad idea by BigGerman · · Score: 3, Insightful

    The ability to write stored procedures in Java has been in Oracle for some time but I still cannot figure out why anyone would do that.
    Java is a nice programming language. Go write web apps, middleware, network software, desktop apps with it but not stored procedures.
    Is mySQL process going to start the whole new JVM on every hit? Or VM is going to run separately and it is bridged somehow (God, not over the network)?
    Now if you ask me, even stored procedures in general become more and more evil.
    And in our age of $50 2Ghz CPUs and Gigabit ehternet the performance is no longer an issue.
    To me, a database is a collection of tables and indexes with referencial integrity, failover and redundancy. It should do just one thing and do it well. Attempts to add features like that seem to be just a marketing thing by their new commercial overlords.

  8. Or Python? by Qa1 · · Score: 2, Insightful
    So when will someone do Ruby?
    Or Python?
  9. Re:Now how about. by DAldredge · · Score: 2, Insightful

    If you have have a second system to run as a slave that may work. In quite a few realworld(tm) situations you don't have that luxury.

    There needs to be someway of doing online back ups of MySQL with out spending money.

  10. It would be if it were true. by Anonymous Coward · · Score: 1, Insightful

    Java is not well supported. Linux, solaris, windows, on x86 or sparc. That's about all that falls in the "well supported" category, maybe macosx. Other OS's and/or architectures have old, broken, or just plain don't have jdks. Maybe if Sun didn't insist on trying to control java in every way, and made it open, then it would really be something. But as is, its just as portable as C#.

  11. Re:Keep this out. by KenSeymour · · Score: 3, Insightful

    The /. crowd keeps hoping Java will go away. They don't want to learn it.

    But it doesn't go away.

    I have noticed that there are several technologies that are held in high regard outside of the Linux/Free Software that are despised within it.

    One is Object Oriented programming. By extension, C++, Java, and UML also fit into this category.
    I wonder how many folks who bash these things have ever actually bothered to learn them?
    It is easier to say that XYZ is "bloated and ugly" than to say "I never learned these things so I can't say how useful they are."
    I also see a lot of "Anyone that does not agree with me is a stupid, clueless, MCSE."

    Name calling is a sign of weak arguments.

    The article is about Java running on the server, behind the scenes. It doesn't "look" like anything.

    I believe server side java is the most common usage of Java. Portability is less of an issue because you control the server environment.
    You can support non-Unix users and still use Unix/Linux for your server.

    --
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
  12. Not my first priority by tacocat · · Score: 2, Insightful

    Java is not my first choice in languages to support in a database language. PL would have at least been more adaptable.

    Unfortunately with the Enterprise Popularity of Java, thanks to a strong Marketing Campaign by Sun Microsystems, MySQL is following the Corporate line of supporting Java regardless. This is a fine example of what may be a mis-direction of the MySQL developers being pushed into a Support the Corporate Enterprise stuff rather then doing good code on a good platform.

    1. Re:Not my first priority by Decaff · · Score: 2, Insightful

      Java not stable or reliable? What planet are you on? Java was designed for stability and reliability. The neatest thing in this context is the SecurityManager, which means you can restrict what it can do within an app server or database, unlike C code or whatever.

  13. Re:Now how about. by Anonymous Coward · · Score: 1, Insightful

    There doesn't need to be a free way of doing everything. Shell out the $$$$ you cheap fuck. Something that saves your job should not be free!

  14. except that for the skill requirements by kpharmer · · Score: 2, Insightful

    No, a stripped-down version of PHP, python, etc would be far better than java.

    Does the LAMP crowd write code in java? nope.

    Do the DBAs write code in java? nope.

    Does the java crowd use mysql? nope (if you're going to the cost of developing apps in java, it makes more sense to use postgresql if not oracle, db2, etc).

    In java you can abstract the data persistence thru a variety of encasulation techniques. All of which creates such a mess than everyone's scrambling these days to figure out how to simplify it. Sounds like a mess to introduce deeper into the database.

    And portability? Do you really think that java functions created for mysql will port *seamlessly* to postgresql, db2, or oracle? No way. And if they don't - why don't you simply write the functions in a tiny, simplistic language that everyone can use easily?

  15. Re:PHP has this for over a year by repetty · · Score: 2, Insightful

    "PHP Dev David Sklar implemented this over a year ago: http://www.sklar.com/page/article/myphp"

    Cool. Very cool. But those execution times are pretty bad. You certainly would want to plan carefully how you used this.

    --Richard

  16. Re:Old hat by ibbey · · Score: 3, Insightful

    Oracle has had this functionality since 8.x. Java is *very* fast inside of Oracle, and is more efficient than PL/SQL in a few cases. Again, OSS is playing catch up.

    SO? Oracle has lots of features that MySQL lacks. The point of the post isn't that this is some wonderful new feature never before seen in the world, only that it's new to MySQL.

    Oh, and one of the fabulous features that Oracle has over MySQL is the price. I mean, who wouldn't prefer to spend many thousands of dollars? This is obviously another area where OSS needs to start playing catch-up.