BindPubs
A Visual J++ 6.0 Sample Application
© 1998 Microsoft Corporation. All rights reserved.
Other product and company names herein may be the trademarks of their respective owners.
Contents - Click any of the items below
BindPubs is a simple example of wfc data binding. It accesses a SQL server that contains the sample database "pubs," retrives all fields of all records in the authors form, and displays them in edit boxes on the form, allowing the user to navigate through them with wfc buttons. The query can be changed through an input box.
- ADO for java through WFC data binding
- Visual J++ 6.0 designed InputBox class
- showDialog() method of the Form class
This sample requires a DSN named pubs that accesses a default database with a table named authors. Choose ODBC (or 32-bit ODBC) in the Control Panel, and create such a DSN. Pubs is the name of the sample database that comes with SQL server; this database contains a table named 'authors.' On NT, replacing the "MySQLServer" string in the included .reg file and importing it to the registry will create a valid System DSN.
Compile both BindPubs.java and InputBox.java and place them in the same folder on a machine that can access the identified SQL server.
To create a Windows .exe file, right-click the project file in the project explorer (which can be opened by hitting ctrl+alt+j) and choose properties. On the "Output Format" tab, check "enable packaging" and choose "Windows EXE" as the package type. Then choose "rebuild" from the Build menu.
If you have your Windows Explorer file associations set to run .class files with wjview,To Change your File Association: Choose "Folder Options" from the explorer's view menu; on the "File Types" tab find "Java Class File" and click the edit button. Type 'run as windows app' in the Action box and 'c:\winnt\wjview.exe "%1"' in the Application used to perform Action just double-click on the file in the Windows Explorer. To run this project in the IDE, double-click on the sln file -- this will load the project. Then hit 'F5,' or the play button.
Enter a valid SQL Query for a table in the database that your Pubs DSN points to by default.
Thank you for using Microsoft products. For more information on Visual J++, visit the Microsoft Corporate Web Site or jump straight to the Visual J++ Owners Area!
You can also visit Microsoft Technical Support and Microsoft Developer Network Online.