11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

100 webMathematica User GuideAn alternative is to place the data file into a directory that is on the Mathematica path setting$Path. This is the approach taken by the example Data1.jsp, which is shown below. Anotheralternative is to place the data file into the same directory as the script, and to use MSPPageDiÖrectory, as shown in the following.data = Import[ ToFileName[MSPPageDirectory[], "file.dat"], "Table"];This was used in the XML example Phone.jsp, which was discussed previously. It is particularlyconvenient to use MSPPageDirectory since it means that data and scripts live in the samedirectory. Thus the entire web application can be moved from one server to another with aminimum of setting up. One disadvantage is that for JSPs the data file can be loaded by a directrequest to the server; thus it should only be used if there is no specialized information presentin the data file. This might be the case if only certain information was suitable to be used in aresponse to each request.HTTP UploadAnother way to load data into a webMathematica server is to send it from the client machinewith the HTTP request. webMathematica contains tools to support this with the functionMSPGetUploadFile. This is demonstrated in the example, Upload.jsp, which is shown below.Database ConnectivityDatabaseLink provides Mathematica with an industrial-strength, ready-made solution for integratingMathematica with any standard SQL database. Integrated since Mathematica 5.1, itprovides a convenient bridge between SQL databases and webMathematica.DatabaseLink is based on Java Database Connectivity (JDBC) technology and so it fits very wellwith the Java technology on which webMathematica is based. It has many useful andimportant features (listed at http://reference.wolfram.com/mathematica/DatabaseLink/tutorial/Overview.html). One particularly useful feature for webMathematica is thatDatabaseLink contains the HSQL Database Engine (HSQLDB), a lightweight database. Thismeans that if you do not already have a database or want to experiment with using one, you donot have to set one up.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!