|
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Product Reviews Visual J++ Database Programming
Visual J++ Database Programming
By: John Fronckowiak
Sep. 1, 1997 12:00 AM
Visual J++ Database Programming Overview
DAO When operating in its native mode, the DAO can create and access Microsoft Access-compatible databases. The DAO can also access external type data sources such as dBase, Paradox and Btrieve type databases. Using ODBC (Open Database Connectivity), the DAO can be used to access server-side databases such as Oracle, Ingres and SQL Server. The DAO is not a true client/server database engine, though. A true client/server database engine would simply serve as a communication layer between the database and the application. Each application that is developed using the DAO will require a local copy of the DAO DLL files to access the database, even if the application is running multiple client computers. The DAO DLLs are not redistributable, but they are provided as part of the Microsoft Office product suite. It is possible, though, to create client/server applications using the DAO by connecting to ODBC database sources. The DAO is best used for standalone applications. Since access to the DAO is provided through a COM class library, Java applications developed using the DAO will only operate on Microsoft Windows platforms (Windows 95 and Windows NT). You won't be able to run DAO applets from your Unix-based Web servers.
RDO The RDO provides a set of objects that assists in the development of client/server applications by addressing their unique requirements. It provides an object-oriented layer of abstraction that directly interfaces with the ODBC API. The RDO uses the ODBC API and the database server drivers to create database server connections, create queries and cursors to navigate the resulting data sets and execute complex procedures relying on the database server for the majority of the processing requirements. Unlike the DAO, which utilizes its own database engine for query preprocessing and connection management, the RDO directly interfaces to the database server. This makes the RDO particularly suited to client/server application development. Figure 2 illustrates the RDO class hierarchy. The DAO and RDO function pretty much in the same manner, allowing an application to connect to a database, submit a query, create a resulting data set or cursor and manipulate the resulting data set. Both the RDO and DAO allow access to server-side database views, stored procedures and transaction management. The biggest difference in both database access models comes in the details of how these tasks are accomplished. The RDO database is not designed for ISAM database access, which means that you shouldn't use the RDO database model to access dBase, Paradox and Btrieve database sources. The RDO model is very much designed for accessing database server data sources, including Oracle, Sybase and SQL Server database servers. Similar to the DAO, access to the RDO is provided through a COM class library. Java applications developed using the RDO will operate only on Microsoft Windows platforms (Windows 95 and Windows NT).
JDBC This is where things begin to get a little tricky. The JDBC drivers utilize the native mode interface to provide access to the ODBC drivers. It becomes tricky here because of the lack of standardization between Microsoft and Sun regarding native mode parameter passing. It is possible to overcome these problems in older versions of Visual J++ using an additional layer that provides native mode parameter translations (this is not easy to do, however). This process has become a lot less complicated with the release of the Microsoft Java SDK version 2.0, which provides better support for the JDBC. Unlike the DAO and the RDO, the JDBC is a universal database access API which can run on any platform. If you're looking at creating a multi-platform Java application which provides access to a relational database, the JDBC is still the way to go. If your applications will be confined to Microsoft-specific platforms, the DAO or RDO may be more familiar choices.
Using the Database Wizard The Java Database Wizard is accessed by selecting the File | New menu options. When the New dialog box is displayed, click on the Projects tab and select the Database Wizard from the list box on the left hand side.
What Does The Wizard Generate? The Database Wizard doesn't come without shortcomings though. I'd certainly like to see the ability to access multiple tables, create joins and have even more control over the appearance of the form. In fact, while I think the Database Wizard provides a great way to get started with Visual J++ database programming, I'd like to see more Database Wizards that help you create smaller components of your applications, such as generating the code to perform complex database queries and other common operations. It's something to hope for in future Visual J++ versions.
Summary Next Month: Visual J++ Under The X-Ray -How To Debug Your Visual J++ Applications Reader Feedback: Page 1 of 1
Latest Cloud Developer Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week
Breaking Cloud Computing News |
|||||||||||||||||||||||||||||||||||||||||||||||||