Introducing JavaBeans Lesson 2A / Slide 1 of 30 JDBC and JavaBeans Pre-assessment Questions 1.Which of the given symbols is used as a placeholder for PreparedStatement.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

Copyright © 2001 Qusay H. Mahmoud JavaBeans An introduction to component-based development in general Introduction to JavaBeans – Java components – client-side.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
1 Chapter 12 Working With Access 2000 on the Internet.
The Microsoft View: Module 1: Getting Started. Copyright Course 2559B, Introduction to Visual Basic®.NET Programming with Microsoft®.NET. Lecture 1 Microsoft.
Java Beans & Serialization CS-328 Dick Steflik. Java Beans Java based component technology –originally developed to provide java with a component technology.
Automating Tasks With Macros
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
By Dr. Jiang B. Liu 12. The Java Beans. Java Beans n JavaBeans is a portable, platform-independent software component model written in Java. It enables.
JavaBeans A component architecture. What is JavaBeans? NC World (New Computing) Dictionary: JavaBeans n. 1. JavaSoft technology. 2. Component object model.
JAVA BEANS By Madhuri Kakumanu. What is a Java Bean? “ A Java Bean is a reusable software component that can be visually manipulated in builder tools.”
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
ASP.NET Programming with C# and SQL Server First Edition
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
M.Sc. Course, Dept. of Informatics and Telecommunications, University of Athens S.Hadjiefthymiades “Web Application Servers” Basics on WAS WAS are necessary.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Introducing JavaBeans Identify the features of a JavaBean Create and add a bean to an application Manipulate bean properties using accessor and mutator.
Java Beans.  Java offers software component development through java Beans  Java Beans are based on a software component model for java.  The model.
Java Beans Component Technology Integrated, Visual Development Environments Reusable Platform-Independent Modular.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Java Beans.
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 10 Introduction to Components. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
OCC Network Drives  H:\  P:\ 
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Components Components are specialized self contained Software entities that can be replicated, Customized and inserted into applications. Components come.
Java Bean Definition “A Java Bean is a reusable software component that can be manipulated visually in a builder tool.”
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Introduction to Java Beans CIS 421 Web-based Java Programming.
First Bean Compose SimpleBean Demo Simple Bean Discuss Manifest and Jar Add Properties to SimpleBean.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
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,
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Java Beans THETOPPERSWAY.COM. Contents What is a Java Bean? Advantages Properties Bean Developers Kit (BDK) What makes Bean possible? Support for Java.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
How to Leverage Java in Oracle Forms Web Applications Duncan Mills Application Development Tools Oracle Corporation.
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.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Running a Forms Developer Application
JAR Files Objectives: 1. Archiving and Packaging Java Code
CIS16 Application Development Programming with Visual Basic
Pre-assessment Questions
Knowledge Byte In this section, you will learn about:
Presentation transcript:

Introducing JavaBeans Lesson 2A / Slide 1 of 30 JDBC and JavaBeans Pre-assessment Questions 1.Which of the given symbols is used as a placeholder for PreparedStatement ? a.# b.* c.? d.% 2.In SQL Server 2000, a _______ is generated when you execute a stored procedure. a.Query plan b.Query c.ResultSet d.Rowset

Introducing JavaBeans Lesson 2A / Slide 2 of 30 JDBC and JavaBeans Pre-assessment Questions (Contd.) 3.Which of the following parameters cannot be used in a stored procedure? a.IN b.OUT c.OUTIN d.INOUT 4.Which of the following enables you to retrieve the information about a ResultSet ? a.DatabaseMetaData b.ResultSetData c.RowSetData d.ResultSetMetaData

Introducing JavaBeans Lesson 2A / Slide 3 of 30 JDBC and JavaBeans Pre-assessment Questions (Contd.) 5.The batch update operations can throw two types of exceptions, __________and ___________. a.SQLException and BatchUpdateException b.SQLExceptio n and UpdateException c.BatchException and BatchUpdateException d.BatchException and SQLException

Introducing JavaBeans Lesson 2A / Slide 4 of 30 JDBC and JavaBeans Solutions to Pre-assessment Questions 1.c. ? 2.a. Query plan 3.c. OUTIN 4.d. ResultSetMetaData 5.a. SQLException and BatchUpdateException

Introducing JavaBeans Lesson 2A / Slide 5 of 30 JDBC and JavaBeans Objectives In this lesson, you will learn about: Features of JavaBeans Associating predefined events with sample JavaBeans Testing JavaBeans using BDK Creating sample JavaBean applet using BDK Creating user-defined JavaBean Creating manifest and JAR files for a JavaBean

Introducing JavaBeans Lesson 2A / Slide 6 of 30 JDBC and JavaBeans JavaBean Concepts A software component is a reusable object that can be plugged into any target software application. You can develop software components using various programming languages, such as C, C++, Java, and Visual Basic. JavaBeans are reusable and platform-independent software components developed using the Java programming language. The classes and interfaces defined in the java.beans package enable you to create JavaBeans. The JavaBean components can exist in one of the following three phases of development: Construction phase Build phase Execution phase

Introducing JavaBeans Lesson 2A / Slide 7 of 30 JDBC and JavaBeans JavaBean Concepts (Contd.) Elements of a JavaBean Properties: Refer to the private data members of a JavaBean that define the behavior of the JavaBeans. Methods: Refer to public member functions of a JavaBean that are used to modify the JavaBean properties. Events: Refer to the messages that one JavaBean components sends to another JavaBean components.

Introducing JavaBeans Lesson 2A / Slide 8 of 30 JDBC and JavaBeans JavaBean Concepts (Contd.) The JavaBean Component Specification Customization: Is the ability of JavaBean to allow its properties to be changed in build and execution phase. Persistence: Is the ability of JavaBean to save its state to disk or storage device and restore the saved state when the JavaBean is reloaded. Communication: Is the ability of JavaBean to notify change in its properties to other JavaBeans or the container. Introspection: Is the ability of a JavaBean to allow an external application to query the properties, methods, and events supported by it.

Introducing JavaBeans Lesson 2A / Slide 9 of 30 JDBC and JavaBeans JavaBean Concepts (Contd.) Services of JavaBean Components Builder support: Enables you to create and group multiple JavaBeans in an application. Layout: Allows multiple JavaBeans to be arranged in a development environment. Interface publishing: Enables multiple JavaBeans in an application to communicate with each other. Event handling: Refers to firing and handling of events associated with a JavaBean. Persistence: Enables you to save the last state of JavaBean.

Introducing JavaBeans Lesson 2A / Slide 10 of 30 JDBC and JavaBeans JavaBean Concepts (Contd.) Types of JavaBeans Control JavaBeans: Are used to create GUI components that can be plugged into any application. Container JavaBeans: Are used to hold other JavaBeans. Invisible Runtime JavaBeans: Are used to create components that perform a specific task in the background of an application.

Introducing JavaBeans Lesson 2A / Slide 11 of 30 JDBC and JavaBeans Beans Development Kit Is a development environment to create, configure, and test JavaBeans. The features of BDK environment are: Provides a GUI to create, configure, and test JavaBeans. Enables you to modify JavaBean properties and link multiple JavaBeans in an application using BDK. Provides a set of sample JavaBeans. Enables you to associate pre-defined events with sample JavaBeans.

Introducing JavaBeans Lesson 2A / Slide 12 of 30 JDBC and JavaBeans Beans Development Kit (Contd.) Identifying BDK Components Execute the run.bat file of BDK to start the BDK development environment. The components of BDK development environment are: ToolBox BeanBox Properties Method Tracer

Introducing JavaBeans Lesson 2A / Slide 13 of 30 JDBC and JavaBeans Beans Development Kit (Contd.) ToolBox window: Lists the sample JavaBeans of BDK. The following figure shows the ToolBox window:

Introducing JavaBeans Lesson 2A / Slide 14 of 30 JDBC and JavaBeans Beans Development Kit (Contd.) BeanBox window: Is a workspace for creating the layout of JavaBean application. The following figure shows the BeanBox window:

Introducing JavaBeans Lesson 2A / Slide 15 of 30 JDBC and JavaBeans Beans Development Kit (Contd.) Properties window: Displays all the exposed properties of a JavaBean. You can modify JavaBean properties in the properties window. The following figure shows the Properties window:

Introducing JavaBeans Lesson 2A / Slide 16 of 30 JDBC and JavaBeans Beans Development Kit (Contd.) Method Tracer window: Displays the debugging messages and method calls for a JavaBean application. The following figure shows the Method Tracer window:

Introducing JavaBeans Lesson 2A / Slide 17 of 30 JDBC and JavaBeans Demonstration-Creating Sample JavaBean Applet using BDK Problem Statement Create an applet that shows the sample Molecule JavaBean rotating along its X-axis.

Introducing JavaBeans Lesson 2A / Slide 18 of 30 JDBC and JavaBeans Demonstration-Creating Sample JavaBean Applet using BDK (Contd.) Solution To create an applet that shows a Molecule JavaBean rotating along its X-axis, you need to perform the following tasks: 1.Associating pre-defined event with sample JavaBeans. 2.Converting the JavaBean to an applet.

Introducing JavaBeans Lesson 2A / Slide 19 of 30 JDBC and JavaBeans User-Defined JavaBean The coding conventions to create a user-defined JavaBean are: Implement the java.io.Serializable interface. Define an empty constructor to initialize the instances of a JavaBean. Define the accessor and mutator methods for the exposed properties of a JavaBean.

Introducing JavaBeans Lesson 2A / Slide 20 of 30 JDBC and JavaBeans User-Defined JavaBean (Contd.) Accessor and Mutator Methods: Are used to access the exposed properties of a JavaBean. The accessor methods: Are used to retrieve the values of JavaBean properties. Are also called get methods. The mutator methods: Are used to specify the values of JavaBean properties. Are also called set methods.

Introducing JavaBeans Lesson 2A / Slide 21 of 30 JDBC and JavaBeans User-Defined JavaBean (Contd.) Manifest and JAR Files Manifest File The manifest file for a JavaBean application contains a list of all the class files that make up a JavaBean. The entry in the manifest file enables the target application to recognize the JavaBean classes for an application. For example, the entry for the SpellCheck JavaBean in the manifest file is as shown: Name: SpellCheck.class Java-Bean: True

Introducing JavaBeans Lesson 2A / Slide 22 of 30 JDBC and JavaBeans User-Defined JavaBean (Contd.) Manifest File (Contd.) The rules to create a manifest file are: Press the Enter key after typing each line in the manifest file. Leave a space after the colon. Type a hyphen between Java and Bean. No blank line between the Name and the Java-Bean entry.

Introducing JavaBeans Lesson 2A / Slide 23 of 30 JDBC and JavaBeans User-Defined JavaBean (Contd.) Java Archive File The files of a JavaBean application are compressed and grouped as JAR files to reduce the size and the download time of the files. The syntax to create a JAR file from the command prompt is: jar The file_names is a list of files for a JavaBean application that are stored in the JAR file.

Introducing JavaBeans Lesson 2A / Slide 24 of 30 JDBC and JavaBeans User-Defined JavaBean (Contd.) Java Archive File (Contd.) The various options that you can specify while creating a JAR file are: c: Indicates the new JAR file is created. f: Indicates that the first file in the file_names list is the name of the JAR file. m: Indicates that the second file in the file_names list is the name of the manifest file. t: Indicates that all the files and resources in the JAR file are to be displayed in a tabular format. v: Indicates that the JAR file should generate a verbose output. x: Indicates that the files and resources of a JAR file are to be extracted. o: Indicates that the JAR file should not be compressed. m: Indicates that the manifest file is not created.

Introducing JavaBeans Lesson 2A / Slide 25 of 30 JDBC and JavaBeans Demonstration-Creating User-Defined JavaBean Problem Statement Create a user-defined JavaBean having a label. Allow the user to change the caption of the user-defined JavaBean at runtime.

Introducing JavaBeans Lesson 2A / Slide 26 of 30 JDBC and JavaBeans Demonstration-Creating User-Defined JavaBean (Contd.) Solution To create a user-defined JavaBean that changes the caption of a label, you need to perform the following tasks: 1.Code the user-defined JavaBean 2.Package the JavaBean 3.Load and test the JavaBean

Introducing JavaBeans Lesson 2A / Slide 27 of 30 JDBC and JavaBeans Summary In this lesson, you learned: A component is a reusable object that can be plugged into any target software application. JavaBeans are reusable and platform-independent software components that are created using the Java programming language. The various features of JavaBean are: Customization Persistence Communication Introspection

Introducing JavaBeans Lesson 2A / Slide 28 of 30 JDBC and JavaBeans Summary (Contd.) JavaBean components provide the following services to the container in which they are grouped together: Builder support Layout Interface publishing Event handling Persistence There are three types of JavaBeans, Control JavaBeans, Container JavaBeans, and Invisible runtime JavaBeans. BDK is a development environment to test and create JavaBeans. The ToolBox window of BDK displays the sample JavaBeans defined in the BDK. The BeanBox window of BDK enables you to test JavaBeans and create applications using various JavaBeans as components.

Introducing JavaBeans Lesson 2A / Slide 29 of 30 JDBC and JavaBeans Summary (Contd.) The properties window displays the properties of the currently selected JavaBean component. The method tracer window of BDK displays the debugging messages and method calls for the BDK environment. BDK provides pre-defined events that can be associated with the sample JavaBean components in an application. The pre-defined events for the sample JavaBeans are displayed in the EventTargetDialog window of BDK. The MakeApplet utility of BDK enables you to create an applet file for a JavaBean application. The applet file can be run using a Web browser or the applet viewer utility of Java. You can also create user-defined JavaBeans using the classes and interfaces provided by the java.beans package.

Introducing JavaBeans Lesson 2A / Slide 30 of 30 JDBC and JavaBeans Summary (Contd.) The accessor and mutator methods of user-defined JavaBean are used to retrieve and specify the value of JavaBean properties. The user-defined JavaBean implements the java.io.Serializable interface. A manifest file is a text file that provides information about the class files that represent a JavaBean. JAR files are platform-independent files that are used to package all the classes and the associated resources for a JavaBean application. The JAR file for the user-defined JavaBean is loaded in the ToolBox window using the File  LoadJar command of the BeanBox window.