(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 4.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 12761, 407]*) (*NotebookOutlinePosition[ 228363, 7848]*) (* CellTagsIndexPosition[ 228286, 7842]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[Cell[BoxData[GridBox[{ { ButtonBox[ StyleBox["\[FirstPage]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageFirst"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"First Slide"], ButtonBox[ StyleBox["\[LeftPointer]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPagePrevious"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Previous Slide"], ButtonBox[ StyleBox["\[RightPointer]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageNext"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Next Slide"], ButtonBox[ StyleBox["\[LastPage]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageLast"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Last Slide"], " ", ButtonBox[ StyleBox[ RowBox[{ CounterBox["SlideShowNavigationBar"], \(\(\ \)\(of\)\(\ \)\), CounterBox["SlideShowNavigationBar", "LastSlide"]}], "SR"], ButtonFrame->"None"]} }]]]], "SlideShowNavigationBar"], Cell[TextData[{ "\n\n", StyleBox["Database Operations with \nJDBC and J/Link", FontFamily->"Arial", FontSize->36] }], "Section"], Cell[TextData[Cell[BoxData[GridBox[{ { ButtonBox[ StyleBox["\[FirstPage]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageFirst"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"First Slide"], ButtonBox[ StyleBox["\[LeftPointer]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPagePrevious"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Previous Slide"], ButtonBox[ StyleBox["\[RightPointer]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageNext"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Next Slide"], ButtonBox[ StyleBox["\[LastPage]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageLast"]}], ButtonStyle->"SlideHyperlink"], " ", ButtonBox[ StyleBox[ RowBox[{ CounterBox["SlideShowNavigationBar"], \(\(\ \)\(of\)\(\ \)\), CounterBox["SlideShowNavigationBar", "LastSlide"]}], "SR"], ButtonFrame->"None"]} }]]]], "SlideShowNavigationBar"], Cell[CellGroupData[{ Cell[TextData[StyleBox["Initialization", FontFamily->"Arial", FontSize->16]], "Section"], Cell["\<\ Off[ General::spell]; Off[General::spell1];\ \>", "Input"], Cell[TextData[{ StyleBox["Load J/Link and Launch Java", FontFamily->"Times New Roman"], "\:f35f" }], "Text"], Cell[BoxData[ \(<< JLink`\)], "Input"], Cell[BoxData[ \(InstallJava[]\)], "Input"], Cell[TextData[{ StyleBox["Load the JDBC/ODBC driver.", FontFamily->"Times New Roman"], "\:f35f", "" }], "Text"], Cell[BoxData[ \(JavaNew[\ "\"]\)], "Input"], Cell[TextData[{ StyleBox["Load the driver manager (to call the getConnection static \ method).", FontFamily->"Times New Roman"], "\:f35f", "" }], "Text"], Cell[BoxData[ \(LoadClass["\"]\)], "Input"] }, Open ]], Cell[TextData[Cell[BoxData[GridBox[{ { ButtonBox[ StyleBox["\[FirstPage]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageFirst"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"First Slide"], ButtonBox[ StyleBox["\[LeftPointer]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPagePrevious"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Previous Slide"], ButtonBox[ StyleBox["\[RightPointer]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageNext"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Next Slide"], ButtonBox[ StyleBox["\[LastPage]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageLast"]}], ButtonStyle->"SlideHyperlink"], " ", ButtonBox[ StyleBox[ RowBox[{ CounterBox["SlideShowNavigationBar"], \(\(\ \)\(of\)\(\ \)\), CounterBox["SlideShowNavigationBar", "LastSlide"]}], "SR"], ButtonFrame->"None"]} }]]]], "SlideShowNavigationBar"], Cell[CellGroupData[{ Cell["Open Database Connection", "Section"], Cell[TextData[{ StyleBox["Done with J/Link style calls, the Java code would be very \ similar.", FontFamily->"Times New Roman"], "\:f35f" }], "Text"], Cell[BoxData[ \(con = java`sql`DriverManager`getConnection[\[IndentingNewLine]"\", \ "\<\>", \ "\<\>"]\)], "Input"] }, Open ]], Cell[TextData[Cell[BoxData[GridBox[{ { ButtonBox[ StyleBox["\[FirstPage]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageFirst"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"First Slide"], ButtonBox[ StyleBox["\[LeftPointer]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPagePrevious"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Previous Slide"], ButtonBox[ StyleBox["\[RightPointer]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageNext"]}], ButtonStyle->"SlideHyperlink", ButtonNote->"Next Slide"], ButtonBox[ StyleBox["\[LastPage]", "SR"], ButtonFunction:>FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "ScrollPageLast"]}], ButtonStyle->"SlideHyperlink"], " ", ButtonBox[ StyleBox[ RowBox[{ CounterBox["SlideShowNavigationBar"], \(\(\ \)\(of\)\(\ \)\), CounterBox["SlideShowNavigationBar", "LastSlide"]}], "SR"], ButtonFrame->"None"]} }]]]], "SlideShowNavigationBar"], Cell[CellGroupData[{ Cell["Execute Query", "Section"], Cell["\<\ Here we will prepare and execute a statement, get all the username from the \ Users table.\ \>", "Text"], Cell[BoxData[ \(st = con@prepareStatement["\