【正文】
will really do the job effectively.MySQL Many sites don39。t need the battleship strength (and price tag) of Oracle. MySQL is an opensource SQL database available for anyone to use, with many (although not all) of the features of its big brothers, such as Oracle. MySQL is available for just about any puter that has decent power—it is fairly lightweight on the processor and easy to install (10 minutes, as opposed to multiple hours for Oracle). So, perhaps you are wondering, what39。s the catch? What are you not getting in MySQL that makes people turn to Oracle? Well, MySQL is a neat little package, but it is missing some things that would be nice to have in a perfect world. A major feature that MySQL does not offer is database consistency checking. You can use foreign key tags in your schema, but MySQL cheerfully ignores them. A lot of DB As I know would consider this a very bad thing.A foreign key constraint prevents you from creating inconsistent data. For example, let39。s suppose that you had a scheme that looked like this: CREATE TABLE USER ( USERID INTEGER, FIRST_NAME VARCHAR(80), LAST_NAME VARCHAR(80))。 CREATE TABLE PURCHASE ( USERID FOREIGN KEY USER(USERID), ITEM INTEGER, QUANTITY INTEGER)。 In a database such as Oracle39。s, if you created an entry in the PURCHASE table with a user ID of 3, there would have to already be a user ID of 3 in the USER table or an error would occur. Similarly, you couldn39。t delete user 3 from USER if it was referenced in MySQL folks make a pretty impassioned argument in their documentation that depending on foreign keys for data integrity is a bad idea anyway, but convincing your DBA of this philosophy is likely to degrade into a religious debate. In addition, some other features are missing, such as subselects and select into. But probably the other major piece that you will miss is the rollback/mit functionality. MySQL does implement rollback and mit for certain types of tables, but not all of them. Again, the MySQL folks offer their own spin on why this is okay, but being able to roll back transactions is (in my opinion) important enough to make sure that you have it available. Rollback allows you to set a savepoint on the database before starting to do a series of transactions with it, and be able to either roll back to the original state or mit the changes at the end. For example, when recording a purchase, you need to record a debit against the user39。s account and enter a record into the shipping table so that you39。ll know later to ship the item. Let39。s say that the second part fails. You wouldn39。t want to charge the user but not ship the item. Thus, you39。d want to roll back to the state before the transaction began.So, MySQL isn39。t a fullblown production database—at least, not yet. It39。s still good enough for probably 90% of the emerce sites in the world, however. And version , which is in alpha as of this writing, addresses a number of these concerns, including rowlevel locking and transaction control.Putting Tomcat and MySQL TogetherCombining Tomcat and MySQL provides a powerful, reliable, and free platform that you can use to learn, develop, and deploy JSP applications. And, best of all, the code that you develop using this platform will run nicely using iPlanet and Oracle or WebSphere and SQL Server.As a learning tool the two together are almost reference implementations of their respective protocols (JSP and SQL). As a result, you won39。t pick up any nasty vendorproprietary bad habits while you39。re getting up to speed. In addition, you can enjoy the knowledge that you are supporting the opensource software movement. Opensource software is code that is made freely available under one of several public licenses, frequently the GNU General Public License (GPL).FACTS AND FICTION ABOUT THE GPLThe GNU General Public License is probably one of the most misunderstood documents in existence,The basics break down to this:1. If you place a piece of software under the GPL, anyone is free to make a copyof it in either source or executable form and give it to anyone else.2. If you take a piece of software under the GPL and use it as a part of yourproduct, you can39。t charge for that product beyond duplication costs.Many people interpret this to mean that they can39。t use GPL software for mercial purposes. Nothing is farther from the truth. What you can39。t do is charge specifically for parts of your product that are partly or largely derived from GPL products.You are free to use GPL code in the development of a Web site because you39。re not selling the site itself to a third party as a product. (Consulting panies fall into a weird quasispace, but no one has gone after them for using GPL software to date.)Why is it good to support this movement? There are two sides to this answer: one technical and one political. Technically, it39。s a good thing because opensource software tends to encourage the development of open standards such as JSP and JDBC, allowing you to choose your tools from among a larger group rather than being locked into one vendor39。s proprietary solution. It39。s a positive thing politically because it keeps the large panies honest. WebLogic and iPlanet have to stay petitive and responsive because they know that there39。s a free solution out there if they aren39。t. And when you use opensource software, you are sending a message that your overriding concerns are features and reliability, not having a large pany to sue if something goes wrong. 譯文MySQL和JSP的Web應(yīng)用程序JSP開發(fā)人員構(gòu)建Web應(yīng)用程序時(shí)遇到需要強(qiáng)大的數(shù)據(jù)庫連接的特殊問題。 MySQL和JSP的Web應(yīng)用程序解決了構(gòu)建數(shù)據(jù)驅(qū)動(dòng)的應(yīng)用程序JavaServer頁面上的發(fā)展模式為基礎(chǔ)的挑戰(zhàn)。 MySQL和JSP的Web應(yīng)用程序開始一個(gè)對(duì)JSP數(shù)據(jù)庫開發(fā) JavaServer頁面,JDBC和數(shù)據(jù)庫模式所需的核心技術(shù)概述。該書然后概述并提出了互聯(lián)網(wǎng)商業(yè)應(yīng)用演示,如接收和處理用戶輸入,設(shè)計(jì)和實(shí)施業(yè)務(wù)規(guī)則,并平衡服務(wù)器上的用戶負(fù)載的概念。通過JDBC(Java數(shù)據(jù)庫連接),開發(fā)人員能夠與大多數(shù)商業(yè)數(shù)據(jù)庫如Oracle進(jìn)