5-1 VISUAL J++ Colorado Technical University IT420 Tim Peterson.

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Chapter 8 Embedded SQL.
1 Chapter 12 Working With Access 2000 on the Internet.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
The ADO Data Control. Universal Data Access Open Database Connectivity (ODBC) –standard for accessing data in databases OLE-DB –allows access to data.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Using Objects and Properties
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Database Programming (using ADO) Universal Data Access – Microsoft strategy for providing access to information across the enterprise. – UDA provides high-performance.
A Guide to SQL, Seventh Edition. Objectives Embed SQL commands in PL/SQL programs Retrieve single rows using embedded SQL Update a table using embedded.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Tutorial 11: Connecting to External Data
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Some Basic Database Terminology
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Databases and LINQ Visual Basic 2010 How to Program 1.
1 ODBC, OLE DB, ADO, and ASP. 2 Introduction  Because database applications today reside in a complicated environment, various standards have been developed.
Chapter 11 Introduction to Database Processing. Class 11: Database Processing Use a Visual Studio Wizard to establish a database connection used to load.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
ASP.NET Programming with C# and SQL Server First Edition
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Database Programming in Java Corresponds with Chapter 32, 33.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
CHAPTER EIGHT Accessing Data Processing Databases.
ADO 2.5 Kamaljit Bath, Program Manager Data Access Group.
Universal Data Access and OLE DB. Customer Requirements for Data Access Technologies High-Performance access to data Reliability Vendor Commitment Broad.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
ActiveX Data Objects (ADO) is Microsoft’s latest database object model. The goal of ADO is to allow VB developers to use a standard set of objects to refer.
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
A Guide to SQL, Eighth Edition Chapter Eight SQL Functions and Procedures.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
What’s new in ADO 2.5 Greg Hinkel Program Manager Data Access Group
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
1 ADO Activex Data Objects. 2 ADO ADO allows users to access data easily from many existing databases (such as Access or Paradox) From ODBC compliant.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
Preface IIntroduction Course Objectives I-2 Course Content I-3 1Introduction to Oracle Reports Developer Objectives 1-2 Business Intelligence 1-3 Enterprise.
ASP.NET Programming with C# and SQL Server First Edition
A Guide to SQL, Seventh Edition
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Chapter 10 ADO.
Database Applications
Unit – V Data Controls.
Presentation transcript:

5-1 VISUAL J++ Colorado Technical University IT420 Tim Peterson

5-2 J++ Advantages There are many Rapid Application Development (RAD) environments for JAVA. Many work on only pure Java. J++ provides many features that can be utilized by Windows systems. J++ is an excellent tool for accessing databases.

5-3 J++ Overview J++ is compatible with SUN’s Java Development Kit (JDK). J++ includes Windows Foundation Classes (WFC). J++ does not support Java Foundation Classes, Java Beans, or Enterprise Java Beans.

5-4 J++ Overview - Cont’d Visual J++ allows users to use DHTML. Visual J++ includes many wizards to help you with development efforts. J++ is targeted towards people building Windows based corporate intranets. J++ is OOP which makes it better than languages such as Vbasic.

5-5 Windows Foundation Classes WFC is used integrate the Windows platform with the Java language. Reasons to use WFC: –Performance is greatly increased. –WFC has a data binding model. –WFC also supports ADO and binds them. If we were to implement our Java code on other platforms, we would not use WFC.

5-6 WFC Implementation WFC is implemented as a Java class layer. WFC provides an object oriented set of classes. WFC allows for URL requests that in turn contain database connectivity. With WFC, you can return HTML to a range of platforms including Windows CE devices, Web TV, and Macintosh.

5-7 WFC Implementation - Cont’d WFC allows a developer to use any method (member function) contained within a DLL. WFC applications will not run on non- windows platforms.’ J++ provides an alternative to using Visual Basic and C++.

5-8 Component Object Model (COM) COM is an integral part of developing Windows- specific intranet applications. In J++, all Java objects become COM objects. Key elements of the WFC API include: –UI based on either Win32 or DHTML –Data binding to a database. –Operations can be performed when connected to the Internet or in an off-line mode. –DOS command line operation.

5-9 WFC Packages The main packages provided in WFC are as follows: com.ms.wfc.app com.ms.wfc.io com.ms.wfc.ax com.ms.wfc.ole32 com.ms.wfc.core com.ms.wfc.ui com.ms.wfc.data com.ms.wfc.util com.ms.wfc. html com.ms.wfc.win32

5-10 GUI Classes GUI classes from package wfc.ui provide: –Provides for control of GUI objects. Examples: Setting and retrieving control properties. Event management of controls. Methods dealing with parent/child relationships of controls. Methods affecting control layouts. Low level control processing. Windows handles, messages, and thread invocation.

5-11 System Classes Part of wfc.app. With WFC, one can manipulate the OS. The developer can encapsulate memory and file objects. Underlying OS platform can be accessed using J/Direct.

5-12 UI/DHTML Code Example Import wfc.ui.* { Form queryForm = new Form(); Button submit = new Button(); submit.setText (“Submit”) submit.setPosition(20,50); queryForm.add(submit); } Import wfc.html.* { DhPanel queryForm = new DhPanel(); DhButton submit = new DhButton(); submit.setText (“Submit”) submit.setPosition(20,50); queryForm.add(submit); }

5-13 DHTML Advantages Allows you to create cross-platform code. It provides for user interaction and data presentation using the following combinations: –HTML –Scripts –Document Object Model

5-14 DHTML Advantages - Cont’d Allows the developer to control the Web Page. DHTML pages can be authored using J++. J++ then generates DHTML code on the fly. To use DHTML in J++, you must extend the DhModule class.

5-15 Example J++ Extending DHTM Public class NewDHTMLClass extends DhModule { public void documentLoad(Object sender, DHEvent e) { DhDocument Dhdoc = getDocument(); Dhdoc.add(new DhText(“Text to see in Web page”)); }

5-16 DHTML Event Handling You work with events using delegates. A delegate declaration extends.com.ms.lang.Delegate. A delegate instance can call a method on an object and pass data to that method. Mainly used to bind events to handler methods.

5-17 WFC Designer WFC Designer tool is best way to build Windows GUIs using J++. With this tool, you can bind data sources to any visual control using drag and drop. Applications built using WFC designer are true Windows applications.

5-18 WFC Designer - Cont’d In general, when using the WFC designer, the following should be accomplished: –Ensure that data controls are added to the toolbox. –Retrieve a set of records –Display the data on the form –Navigate the records. If the above can be done, the integrity of the WFC is most likely sound.

5-19 DataSource Control In the WFC designer, the DataSource control provides for data access for J++. DataSource combines the functionality of Connection, Command, and Recordset objects. DataSource only retrieves data and does not display it. To being using DataSource, it must be added to a form.

5-20 DataSource Control - Cont’d To connect to a database, you must set the connectionString property. To access an ODBC data source, the string is as follows: DSN=Nwind; UID=peterson; PWD=password To access an Access database, the string is as follows: Provider=Microsoft.Jet.OLEDB.3.51; Data Source=filename; User ID=UserID; Password=password; After this, then the SQL command is entered.

5-21 DataBinder Control Now that the records have been retrieved, the data must be bound to a display. If an attempt is made to updated a read-only recordset, and ADO exception is generated. The DataBinder can only bind components that exist on the same WFC design surface. DataBinder does not provide any means to validate changes made to a property’s value.

5-22 DataBinder Control - Cont’d Components of bound properties can provide events. To support a property change request, a Changing event exists.

5-23 Universal Data Access UDA is Microsoft’s solution to providing high-performance access to data. UDA enables access to any data source on any platform. An API is included for this. Components that make this possible are ADO, Remote Data Services, OLE DB, and ODBC.

5-24 Java ActiveX Data Objects JADO builds on ADO to present a simplified API. JADO components include: –Connection objects –Command objects –Recordset objects Purpose of JADO is to provide access to, to edit, and to update data sources.

5-25 JADO Abilities Establish a connection to a data source. Create an object. Parameterize SQL statements with variable parameters using the Parameter object. Execute the commands using the Connection, Command, or Recordset object.

5-26 JADO Abilities - Cont’d Edit Recordsets. Cache returned rows using a Recordset object. Update data source with cached data. Sort, filter, and navigate data in cache. Commit and rollback changes and then end the connection using the Connection object.

5-27 Connection Object Connection object is an open connection to a data source. JADO accesses data and services from an OLE DB provider. The connection object specifies: –the particular provider –associated parameters

5-28 Connection Object Open and Close Methods The Open method establishes a physical connection to the data source. –Once live, you can issue commands against it. The Close method is used to close a connection or free associated system resources. Closing an object does not remove it from memory.

5-29 Connection Object Transactions Transactions delimit the beginning and end of data access operations across a connection. JADO ensures that transaction is totally complete prior to issuing a Commit. If transaction is not completed, JADO issues a rollback.

5-30 Command Object Command object is the definition of the command to run against a data source. Commands normally add, delete, update, or retrieve data in a data source. JADO optimizes the execution of the command. With the Command object, multiple commands can be associated with a single object.

5-31 Parameter Object This object allows you to treat parameters like functions. All you need to know is this interface and how to pass to it. This is used with the command object. Use the CreateParameter method to create objects and use Append to add them to the Parameters collection.

5-32 Recordset Object A recordset object reflects data from a row- returning query. This object represents the set of records from a table or results from an executed command. Recordset is used to examine and update data.

5-33 Recordset Object Capabilities Recordset Objects perform the following: –Manage state of the Recordset. –Add, update, and delete rows –Traverse rows –Specify available rows –Specify order of rows –Update the data source with changes to rows.

5-34 Recordset Object Cursors Recordsets are created using rows and columns. JADO provides for four cursor types: –Dynamic –Keyset –Static –Forward-only CursorType property must be set prior to opening the Recordset.

5-35 Field Object To modify data in a data source, the Field objects are first modified. Field objects can perform: –Get or set data in Field with Value Property. –Get the name of the field (Name Property). –Get attributes (Type, Precision, and Numeric scale).

5-36 Field Object - Cont’d –Obtain size of a field with DefinedSize and ActualSize properties. –Manipulate binary and char files with AppendChunk and GetChunk. –Determine functionality of a field by using the attributes property. The value property of a field is handled as a variant.

5-37 Error Object Errors with JADO usually are: –Failure to establish a connection. –Failure to execute a command. –Failure to perform an operation on an object in a suitable state. Errors are placed in the Errors collection of the Connection object.

5-38 Error Object Properties The Error object allows you to use the following properties: –Description –Number –Source –HelpFile and HelpContext –SQL State and NativeError

5-39 Collections Under JADO, Collections exist for: –Parameter Objects –Field Objects –Error Objects Data is retrieved using the collection method by name, text string, or integer number referencing it’s position in the collection.

5-40 Using Recordsets Remotely JADO also provides the ability to develop off-network. Users can download Remoteable Recordsets (a subset of the source data). Developers can then create code to modify this Recordset off-line.

5-41 Visual Database Tools Data View - used to connect to any ODBC or OLE DB database. Database Designer - used to create and modify SQL server databases. Query Designer - used to design, execute, and save SQL queries. Stored Procedure Editor - Used to create STPs. Stored Procedure Debugger - Used to debug STPs.