11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

webMathematica User Guide 107Database Connections: Database.jspIf you installed webMathematica as described above, you should be able to connect to this JSPvia http://localhost:8080/webMathematica/Examples/Database/Database.jsp. (You may havesome other URL for accessing your server.)This example shows how to use DatabaseLink to connect to an SQL database. The databasein question is one that is contained in HSQLDB, and for it to work the sampledatabases need to be installed. This is described in the documentation (http://reference.wolfram.com/mathematica/DatabaseLink/tutorial/Overview.html). The databases areinstalled into $UserBaseDirectory, and so you need to make sure this is $UserBaseDirectoryfor the user who is running webMathematica.This example shows how you can open a connection to a database and make a query to aparticular table based on an input parameter. The data is displayed with HTMLTableForm.Lower limit: Needs["DatabaseLink`"];limit = 6000;If[MSPValueQ[$$limit],limit = MSPToExpression[$$limit]];conn = OpenSQLConnection["publisher"];headings = {"TITLE_ID" , "LORANGE", "HIRANGE", "ROYALTY"};data = SQLSelect[conn, {"ROYSCHED"}, headings, SQLColumn["LORANGE"] >limit];Royalty Schedule Table

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

Saved successfully!

Ooh no, something went wrong!