The International Journal of Mechanical Engineering Research and Technology is an international online journal published Quarterly offers fast publication schedule whilst maintaining rigorous peer review. The use of recommended electronic formats for article delivery expedites the process All submitted research articles are subjected to the immediate rapid screening by editors consultation with Editorial Board or others working in the field of appropriate to ensure that they are likely to be the level of interest and importance of appropriate for the journal.
This document summarizes key concepts relating to the relational model in database systems, including:
- The structure of relational databases and examples of relations and tuples.
- Relational algebra as a procedural query language consisting of operations like selection, projection, join, union and set differences.
- Nonprocedural query languages like tuple and domain relational calculus.
- Examples of relational algebra operations like selection, projection, join, union and set differences applied to relations.
This document discusses values, data types, and the five standard data types in Python. It defines that values are the fundamental things like numbers and strings that programs manipulate. Data type refers to the type and size of data that variables can hold. The five main data types in Python are numbers, strings, lists, tuples, and dictionaries. Numbers include integers, floating point values, and complex numbers. Lists and tuples are ordered sequences that can hold heterogeneous data, but lists are mutable while tuples are immutable. Strings are ordered sequences of characters. Dictionaries are unordered collections of key-value pairs.
This chapter discusses the fundamentals of electronics including gain, attenuation, decibels, tuned circuits, and resonance. It covers topics such as reactive components like capacitors and inductors, series and parallel resonant circuits, and quality factor. Gain is the ratio of output to input signal, while attenuation refers to signal loss. The decibel is used to quantify gain and loss, with additions and subtractions used. Tuned circuits containing inductors and capacitors resonate at specific frequencies. Series and parallel circuits demonstrate resonance when reactances are equal.
Gereksinim analizi çalışmaları yazılım projelerinin başarıya ulaşabilmesi için yapılması gereken en önemli iştir. Doğru şekilde ihtiyaçları ortaya konmuş projeler ancak başarılı olabilirler.Gereksinim analiz çalışmaları iki aşamadan meydana gelir; Gereksinimlerin ortaya çıkarılması
Gereksinimlerin öncelik durumuna göre analiz edilmesi. Bu sunumda iyi bir proje için gerekli olan gereksinim analiz dokümanı hazırlama yöntemi verilmiştir.
The document discusses the key concepts of the relational model and relational databases. It defines relations (tables) and their components like attributes, tuples, domains, and keys. It explains the properties of relations including distinct relation names, single values per cell, distinct attribute names, and domains. It describes the different types of keys like super keys, candidate keys, primary keys, foreign keys, and composite keys. It also covers integrity rules including entity integrity which requires each table to have a unique primary key, and referential integrity which requires foreign keys to match the primary keys in other tables they reference.
The document discusses various SQL concepts like views, triggers, functions, indexes, joins, and stored procedures. Views are virtual tables created by joining real tables, and can be updated, modified or dropped. Triggers automatically run code when data is inserted, updated or deleted from a table. Functions allow reusable code and improve clarity. Indexes allow faster data retrieval. Joins combine data from different tables. Stored procedures preserve data integrity.
This document defines SQL data definition statements and basic SQL query structure. It discusses DDL statements like CREATE, ALTER, and DROP that are used to define and manage database structures. It also explains the typical components of an SQL query including the SELECT, FROM, and WHERE clauses. Finally, it outlines several set operations in SQL like UNION, UNION ALL, INTERSECT, and MINUS.
This document discusses implementation of inheritance in Java and C#. It covers key inheritance concepts like simple, multilevel, and hierarchical inheritance. It provides examples of inheritance in Java using keywords like extends, super, this. Interfaces are discussed as a way to achieve multiple inheritance in Java. The document also discusses implementation of inheritance in C# using concepts like calling base class constructors and defining virtual methods.
ACID properties
Atomicity, Consistency, Isolation, Durability
Transactions should possess several properties, often called the ACID properties; they should be enforced by the concurrency control and recovery methods of the DBMS.
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
Functional dependency defines a relationship between attributes in a table where a set of attributes determine another attribute. There are different types of functional dependencies including trivial, non-trivial, multivalued, and transitive. An example given is a student table with attributes Stu_Id, Stu_Name, Stu_Age which has the functional dependency of Stu_Id->Stu_Name since the student ID uniquely identifies the student name.
A SQL subquery is a query nested inside another query. Subqueries can be used in the SELECT, WHERE, INSERT, UPDATE, or DELETE clauses. The subquery executes first and its results are then used by the outer query. There are three types of subqueries: single row, multiple row, and multiple column. Single row subqueries use comparison operators like =, <, > and return one row. Multiple row subqueries use operators like IN, ANY, ALL and return multiple rows. Multiple column subqueries compare more than one column between the outer and inner queries.
In DBMS (DataBase Management System), the relation algebra is important term to further understand the queries in SQL (Structured Query Language) database system. In it just give up the overview of operators in DBMS two of one method relational algebra used and another name is relational calculus.
Normalisation is a process that structures data in a relational database to minimize duplication and redundancy while preserving information. It aims to ensure data is structured efficiently and consistently through multiple forms. The stages of normalization include first normal form (1NF), second normal form (2NF), third normal form (3NF), Boyce-Codd normal form (BCNF), fourth normal form (4NF) and fifth normal form (5NF). Higher normal forms eliminate more types of dependencies to optimize the database structure.
This chapter discusses advanced SQL features including relational set operators like UNION and INTERSECT, different types of joins, subqueries, functions, views, triggers, stored procedures, cursors, and embedded SQL. It covers topics like using subqueries in the SELECT, WHERE, HAVING and FROM clauses, correlated subqueries, date/string/numeric functions, updatable views, procedural language features in PL/SQL including triggers and stored procedures, and static versus dynamic embedded SQL.
The document discusses different types of SQL joins, including inner joins, outer joins, equi joins, non-equi joins, natural joins, cross joins, left joins, right joins, full outer joins, and self joins. It provides the syntax and examples for each type of join. It also discusses joining tables through referential integrity, where a foreign key references a primary key in another table to link the tables together.
This document discusses classes, objects, and methods in Java. It defines a class as a user-defined data type that contains fields and methods. Objects are instances of classes that allocate memory at runtime. Methods define behaviors for objects and are declared within classes. The document covers defining classes, creating objects, accessing members, constructors, method overloading and overriding, static members, passing objects as parameters, recursion, and visibility control.
This document provides an overview of Java Swing components. It defines Swing as a GUI toolkit built on top of AWT that provides platform-independent and lightweight components. It describes common Swing components like JButton, JTextField, JTextArea and their usage. It also compares AWT and Swing, explaining how Swing components are more powerful and support pluggable look and feel while AWT is platform-dependent. Examples are given to demonstrate creating and using Swing components like JButton, JTextField, JTextArea etc.
This document provides an overview of object-oriented analysis and design. It defines key terms and concepts in object-oriented modeling like use cases, class diagrams, states, sequences. It describes developing requirements models using use cases and class diagrams. It also explains modeling object behavior through state and sequence diagrams and transitioning analysis models to design.
A distributed database is a collection of logically interrelated databases distributed over a computer network. A distributed database management system (DDBMS) manages the distributed database and makes the distribution transparent to users. There are two main types of DDBMS - homogeneous and heterogeneous. Key characteristics of distributed databases include replication of fragments, shared logically related data across sites, and each site being controlled by a DBMS. Challenges include complex management, security, and increased storage requirements due to data replication.
This document discusses aggregate functions in SQL. It defines aggregate functions as functions that summarize expression results over multiple rows into a single value. Commonly used aggregate functions include SUM, COUNT, AVG, MIN, and MAX. Examples are provided calculating sums, averages, minimums, and maximums of salaries in an employee table to illustrate the use of these functions. It also discusses issues like ignoring null values and the need to use the GROUP BY clause with aggregate functions.
This document summarizes the key topics covered in Chapter 9 of a SQL textbook, including assertions to specify general constraints, views which allow querying of virtual tables, various techniques for database programming using embedded SQL, Java Database Connectivity (JDBC), and stored procedures.
The document discusses various SQL concepts like views, triggers, functions, indexes, joins, and stored procedures. Views are virtual tables created by joining real tables, and can be updated, modified or dropped. Triggers automatically run code when data is inserted, updated or deleted from a table. Functions allow reusable code and improve clarity. Indexes allow faster data retrieval. Joins combine data from different tables. Stored procedures preserve data integrity.
This document defines SQL data definition statements and basic SQL query structure. It discusses DDL statements like CREATE, ALTER, and DROP that are used to define and manage database structures. It also explains the typical components of an SQL query including the SELECT, FROM, and WHERE clauses. Finally, it outlines several set operations in SQL like UNION, UNION ALL, INTERSECT, and MINUS.
This document discusses implementation of inheritance in Java and C#. It covers key inheritance concepts like simple, multilevel, and hierarchical inheritance. It provides examples of inheritance in Java using keywords like extends, super, this. Interfaces are discussed as a way to achieve multiple inheritance in Java. The document also discusses implementation of inheritance in C# using concepts like calling base class constructors and defining virtual methods.
ACID properties
Atomicity, Consistency, Isolation, Durability
Transactions should possess several properties, often called the ACID properties; they should be enforced by the concurrency control and recovery methods of the DBMS.
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
Functional dependency defines a relationship between attributes in a table where a set of attributes determine another attribute. There are different types of functional dependencies including trivial, non-trivial, multivalued, and transitive. An example given is a student table with attributes Stu_Id, Stu_Name, Stu_Age which has the functional dependency of Stu_Id->Stu_Name since the student ID uniquely identifies the student name.
A SQL subquery is a query nested inside another query. Subqueries can be used in the SELECT, WHERE, INSERT, UPDATE, or DELETE clauses. The subquery executes first and its results are then used by the outer query. There are three types of subqueries: single row, multiple row, and multiple column. Single row subqueries use comparison operators like =, <, > and return one row. Multiple row subqueries use operators like IN, ANY, ALL and return multiple rows. Multiple column subqueries compare more than one column between the outer and inner queries.
In DBMS (DataBase Management System), the relation algebra is important term to further understand the queries in SQL (Structured Query Language) database system. In it just give up the overview of operators in DBMS two of one method relational algebra used and another name is relational calculus.
Normalisation is a process that structures data in a relational database to minimize duplication and redundancy while preserving information. It aims to ensure data is structured efficiently and consistently through multiple forms. The stages of normalization include first normal form (1NF), second normal form (2NF), third normal form (3NF), Boyce-Codd normal form (BCNF), fourth normal form (4NF) and fifth normal form (5NF). Higher normal forms eliminate more types of dependencies to optimize the database structure.
This chapter discusses advanced SQL features including relational set operators like UNION and INTERSECT, different types of joins, subqueries, functions, views, triggers, stored procedures, cursors, and embedded SQL. It covers topics like using subqueries in the SELECT, WHERE, HAVING and FROM clauses, correlated subqueries, date/string/numeric functions, updatable views, procedural language features in PL/SQL including triggers and stored procedures, and static versus dynamic embedded SQL.
The document discusses different types of SQL joins, including inner joins, outer joins, equi joins, non-equi joins, natural joins, cross joins, left joins, right joins, full outer joins, and self joins. It provides the syntax and examples for each type of join. It also discusses joining tables through referential integrity, where a foreign key references a primary key in another table to link the tables together.
This document discusses classes, objects, and methods in Java. It defines a class as a user-defined data type that contains fields and methods. Objects are instances of classes that allocate memory at runtime. Methods define behaviors for objects and are declared within classes. The document covers defining classes, creating objects, accessing members, constructors, method overloading and overriding, static members, passing objects as parameters, recursion, and visibility control.
This document provides an overview of Java Swing components. It defines Swing as a GUI toolkit built on top of AWT that provides platform-independent and lightweight components. It describes common Swing components like JButton, JTextField, JTextArea and their usage. It also compares AWT and Swing, explaining how Swing components are more powerful and support pluggable look and feel while AWT is platform-dependent. Examples are given to demonstrate creating and using Swing components like JButton, JTextField, JTextArea etc.
This document provides an overview of object-oriented analysis and design. It defines key terms and concepts in object-oriented modeling like use cases, class diagrams, states, sequences. It describes developing requirements models using use cases and class diagrams. It also explains modeling object behavior through state and sequence diagrams and transitioning analysis models to design.
A distributed database is a collection of logically interrelated databases distributed over a computer network. A distributed database management system (DDBMS) manages the distributed database and makes the distribution transparent to users. There are two main types of DDBMS - homogeneous and heterogeneous. Key characteristics of distributed databases include replication of fragments, shared logically related data across sites, and each site being controlled by a DBMS. Challenges include complex management, security, and increased storage requirements due to data replication.
This document discusses aggregate functions in SQL. It defines aggregate functions as functions that summarize expression results over multiple rows into a single value. Commonly used aggregate functions include SUM, COUNT, AVG, MIN, and MAX. Examples are provided calculating sums, averages, minimums, and maximums of salaries in an employee table to illustrate the use of these functions. It also discusses issues like ignoring null values and the need to use the GROUP BY clause with aggregate functions.
This document summarizes the key topics covered in Chapter 9 of a SQL textbook, including assertions to specify general constraints, views which allow querying of virtual tables, various techniques for database programming using embedded SQL, Java Database Connectivity (JDBC), and stored procedures.
LM7_ Embedded Sql and Dynamic SQL in dbmsBalaKrish12
This document contains information about a Database Management Systems course, including the name of the faculty member, course code, outcomes, syllabus topics, and details about embedded SQL and dynamic SQL. The topics covered include connecting to a database, declaring and using variables in SQL statements, opening and fetching from a cursor to retrieve data, and using cursors to update tuples in the database.
Embedded SQL allows SQL statements to be embedded within host languages like C/C++/Java. Embedded SQL statements are distinguished by being enclosed between EXEC SQL and END-EXEC. Variables shared between SQL and the host language are prefixed with a colon in SQL. Dynamic SQL constructs SQL statements at runtime, allowing for flexibility, while static SQL has statements hardcoded at compile time, providing better performance.
The document discusses different approaches for connecting programming languages like C to databases like Oracle. It covers embedded SQL, which allows SQL statements directly in C code. It also covers call-level interfaces like CLI and JDBC, which use library functions to execute SQL statements as character strings. Key topics include preparing statements, executing queries, fetching result sets, and binding variables.
The document discusses embedded SQL statements and stored procedures in Oracle databases. Embedded SQL allows SQL statements to be placed within a host programming language like C/C++. Stored procedures are named PL/SQL blocks that perform specific database-related tasks. Triggers are PL/SQL blocks that automatically execute in response to data changes, such as inserts or updates.
This document provides an overview of SQL and embedded SQL concepts. It discusses scalar subqueries, embedded SQL programming, transactions, dynamic SQL, and JDBC. Scalar subqueries return single values that can be used in expressions or output clauses. Embedded SQL allows embedding SQL statements in programming languages for connectivity. Transactions define units of work that can be committed or rolled back. Dynamic SQL builds SQL statements dynamically at runtime using strings, while JDBC is the Java database connectivity API.
This document provides an overview of database application development and embedded SQL. It discusses how embedded SQL allows integrating SQL queries into high-level programming languages like C++, Java, and Python. This enables applications to easily perform logic and fetch/feed data from databases. The document also covers advantages of embedded SQL, variable declaration in SQL, implicit and explicit cursors, and JDBC.
Advanced SQL - Database Access from Programming LanguagesS.Shayan Daneshvar
This document discusses various approaches for accessing databases from programming languages, including dynamic SQL, embedded SQL, standards like ODBC, JDBC, ADO/ADO.NET, and examples of using these standards. It covers connecting to databases, executing queries and stored procedures, handling results, and addressing issues like SQL injection. Other topics mentioned include database metadata, transactions, repository patterns, object-relational mapping tools, and database version control.
The document discusses various topics related to integrating programming languages with databases, including:
1. Object persistence and serialization allow objects in programming languages to be stored and retrieved from databases.
2. Most applications use an RDBMS for data storage while using an object-oriented language for development, requiring objects to be mapped to database tables.
3. Embedded SQL and database drivers allow programming languages to execute SQL statements and interact with databases, addressing the "impedance mismatch" between object-oriented and relational models.
PL/SQL is a standard and portable language for Oracle Database development. If you develop a program that executes on an Oracle Database, you can quickly move it to another compatible Oracle Database without any changes. PL/SQL is an embedded language. PL/SQL only can execute in an Oracle Database.
The document discusses stored procedures and embedded SQL. Stored procedures allow functions to be stored on the database server and reduce network traffic by being invoked multiple times. They can be written in languages like SQL, C, or Java. Embedded SQL is used to interface SQL with a host programming language by embedding SQL statements directly into program code using syntax like EXEC SQL.
This document discusses dynamic SQL and metadata in Oracle. It describes how to build and execute SQL statements dynamically using native dynamic SQL with EXECUTE IMMEDIATE statements or the DBMS_SQL package. It also explains how to use the DBMS_METADATA package to obtain metadata from the data dictionary as XML or DDL that can be used to re-create database objects. Examples are provided for dynamic SQL DDL, DML, queries and PL/SQL blocks.
This document discusses database programming techniques and JDBC (Java Database Connectivity). It covers four main database programming approaches: embedded SQL, library function calls like JDBC, and stored procedures. The bulk of the document focuses on using JDBC to connect to a database from Java code, including connecting, executing queries, processing result sets, and closing connections. It provides examples of querying a database and retrieving results into Java variables.
This document provides an overview of SQL programming and PL/SQL. It discusses pros and cons of SQL, introduces basic PL/SQL features like variables, branches, loops, and data modification statements. It also covers PL/SQL concepts like cursors, stored procedures, embedded SQL, and dynamic SQL. Examples are provided to illustrate key points.
Ibm db2 10.5 for linux, unix, and windows developing embedded sql applicationsbupbechanhgmail
This document provides an overview of developing embedded SQL applications for DB2 databases. It discusses embedding SQL statements in various host languages like C/C++, COBOL, FORTRAN and REXX. It covers topics like designing embedded SQL applications, programming embedded SQL with host variables and SQL statements, building applications by precompiling, compiling and binding, and deploying the final applications. The document also includes appendices about the DB2 technical library and compatibility features for migration.
PL/SQL provides two types of composite datatypes - records and collections. Records allow grouping of related data elements, while collections allow storing multiple values in a single variable. Collections include index-by tables, nested tables, and varrays. Cursors allow processing rows from a SQL query one by one. Explicit cursors must be declared, opened, fetched from, and closed. Implicit cursors are used for DML statements. Functions return a value and can be used in SQL expressions, while procedures perform actions without returning a value. Both can accept parameters.
This document discusses various SQL programming techniques, including embedded SQL, views, stored procedures, and database access from general-purpose programming languages. It covers defining views and constraints, using embedded SQL in languages like C and Java via APIs like JDBC, and executing dynamic SQL statements via functions. The key approaches outlined are embedded SQL, stored procedures, functional calls using SQL/CLI, and object-oriented access through JDBC in Java.
What is PL/SQL
Procedural Language – SQL
An extension to SQL with design features of programming languages (procedural and object oriented)
PL/SQL and Java are both supported as internal host languages within Oracle products.
JDBC provides a standard interface for connecting to relational databases from Java applications. It establishes a connection with a database, allows sending SQL statements to it, and processing the results. The key classes and interfaces in JDBC are located in the java.sql package. JDBC supports connecting to all major databases and provides a consistent API for database access.
Impurities of Water and their Significance.pptxdhanashree78
Impart Taste, Odour, Colour, and Turbidity to water.
Presence of organic matter or industrial wastes or microorganisms (algae) imparts taste and odour to water.
Presence of suspended and colloidal matter imparts turbidity to water.
First Review PPT gfinal gyft ftu liu yrfut goSowndarya6
CyberShieldX provides end-to-end security solutions, including vulnerability assessment, penetration testing, and real-time threat detection for business websites. It ensures that organizations can identify and mitigate security risks before exploitation.
Unlike traditional security tools, CyberShieldX integrates AI models to automate vulnerability detection, minimize false positives, and enhance threat intelligence. This reduces manual effort and improves security accuracy.
Many small and medium businesses lack dedicated cybersecurity teams. CyberShieldX provides an easy-to-use platform with AI-powered insights to assist non-experts in securing their websites.
Traditional enterprise security solutions are often expensive. CyberShieldX, as a SaaS platform, offers cost-effective security solutions with flexible pricing for businesses of all sizes.
Businesses must comply with security regulations, and failure to do so can result in fines or data breaches. CyberShieldX helps organizations meet compliance requirements efficiently.
A SEW-EURODRIVE brake repair kit is needed for maintenance and repair of specific SEW-EURODRIVE brake models, like the BE series. It includes all necessary parts for preventative maintenance and repairs. This ensures proper brake functionality and extends the lifespan of the brake system
This study will provide the audience with an understanding of the capabilities of soft tools such as Artificial Neural Networks (ANN), Support Vector Regression (SVR), Model Trees (MT), and Multi-Gene Genetic Programming (MGGP) as a statistical downscaling tool. Many projects are underway around the world to downscale the data from Global Climate Models (GCM). The majority of the statistical tools have a lengthy downscaling pipeline to follow. To improve its accuracy, the GCM data is re-gridded according to the grid points of the observed data, standardized, and, sometimes, bias-removal is required. The current work suggests that future precipitation can be predicted by using precipitation data from the nearest four grid points as input to soft tools and observed precipitation as output. This research aims to estimate precipitation trends in the near future (2021-2050), using 5 GCMs, for Pune, in the state of Maharashtra, India. The findings indicate that each one of the soft tools can model the precipitation with excellent accuracy as compared to the traditional method of Distribution Based Scaling (DBS). The results show that ANN models appear to give the best results, followed by MT, then MGGP, and finally SVR. This work is one of a kind in that it provides insights into the changing monsoon season in Pune. The anticipated average precipitation levels depict a rise of 300–500% in January, along with increases of 200-300% in February and March, and a 100-150% increase for April and December. In contrast, rainfall appears to be decreasing by 20-30% between June and September.
This document provides information about the Fifth edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
How Binning Affects LED Performance & Consistency.pdfMina Anis
🔍 What’s Inside:
📦 What Is LED Binning?
• The process of sorting LEDs by color temperature, brightness, voltage, and CRI
• Ensures visual and performance consistency across large installations
🎨 Why It Matters:
• Inconsistent binning leads to uneven color and brightness
• Impacts brand perception, customer satisfaction, and warranty claims
📊 Key Concepts Explained:
• SDCM (Standard Deviation of Color Matching)
• Recommended bin tolerances by application (e.g., 1–3 SDCM for retail/museums)
• How to read bin codes from LED datasheets
• The difference between ANSI/NEMA standards and proprietary bin maps
🧠 Advanced Practices:
• AI-assisted bin prediction
• Color blending and dynamic calibration
• Customized binning for high-end or global projects
11th International Conference on Data Mining (DaMi 2025)kjim477n
Welcome To DAMI 2025
Submit Your Research Articles...!!!
11th International Conference on Data Mining (DaMi 2025)
July 26 ~ 27, 2025, London, United Kingdom
Submission Deadline : June 07, 2025
Paper Submission : https://csit2025.org/submission/index.php
Contact Us : Here's where you can reach us : [email protected] or [email protected]
For more details visit : Webpage : https://csit2025.org/dami/index
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...ijfcstjournal
One of the major challenges for software, nowadays, is software cost estimation. It refers to estimating the
cost of all activities including software development, design, supervision, maintenance and so on. Accurate
cost-estimation of software projects optimizes the internal and external processes, staff works, efforts and
the overheads to be coordinated with one another. In the management software projects, estimation must
be taken into account so that reduces costs, timing and possible risks to avoid project failure. In this paper,
a decision- support system using a combination of multi-layer artificial neural network and decision tree is
proposed to estimate the cost of software projects. In the model included into the proposed system,
normalizing factors, which is vital in evaluating efforts and costs estimation, is carried out using C4.5
decision tree. Moreover, testing and training factors are done by multi-layer artificial neural network and
the most optimal values are allocated to them. The experimental results and evaluations on Dataset
NASA60 show that the proposed system has less amount of the total average relative error compared with
COCOMO model.
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODSsamueljackson3773
In this paper, the author discusses the concerns of using various wireless communications and how to use
them safely. The author also discusses the future of the wireless industry, wireless communication
security, protection methods, and techniques that could help organizations establish a secure wireless
connection with their employees. The author also discusses other essential factors to learn and note when
manufacturing, selling, or using wireless networks and wireless communication systems.
1. Click to add Title
Embedded SQL, Dynamic SQL
and SQLJ
e-Infochips Institute of Training Research and Academics Limited
Prepared By:-
Dharita Chokshi
2. Outlines
• What is SQL
• What is Embedded SQL
• Cursors
• Dynamic SQL
• SQLJ
• Summary
3. What is SQL?
• Structured Query Language (SQL) is a standardized language
used to manipulate database objects and the data they
contain.
• It comprised of several different statements that are used
manipulate data values.
• SQL being a nonprocedural is not a general-purpose
programming language.
UPDATE EMPLOYEE SET LASTNAME = 'Jones' WHERE
EMPID = '001'
4. What is Embedded SQL?
• As a result, database applications are usually developed by
combining capabilities of a high-level programming language
with SQL.
• The simplest approach is to embed SQL statements directly
into the source code file(s) that will be used to create an
application. This technique is referred to as embedded SQL
programming.
• sqlca.h – header file to be included.
5. Embedded SQL
• High-level programming language compilers cannot interpret,
SQL statements.
• Hence source code files containing embedded SQL
statements must be preprocessed before compiling.
• Thus each SQL statement coded in a high-level programming
language source code file must be prefixed with the keywords
EXEC SQL and terminated with either a semicolon or the
keywords END_EXEC.
6. Embedded SQL
• Likewise, the Database Manager cannot work directly with
high-level programming language variables.
• Instead, it must use special variables known as host
variables to move data between an application and a
database.
• Two types of Host variables:-
1. Input Host Variables – Transfer data to database
2. Output Host Variables – receives data from database
7. Embedded SQL
• Host variables are ordinary programming language variables.
• To be set apart, they must be defined within a special section
known as a declare section.
EXEC SQL BEGIN DECLARE SECTION
char EmployeeID[7];
double Salary;
EXEC SQL END DECLARE SECTION
• Each host variable must be assigned a unique name
even though declared in different declaration section.
8. Embedded SQL
main() {
EXEC SQL BEGIN DECLARE SECTION;
int OrderID, CustID;
char SalesPerson[10], Status[6];
EXEC SQL END DECLARE SECTION;
printf ("Enter order number: ");
scanf ("%d", &OrderID);
EXEC SQL SELECT CustID, SalesPerson, Status FROM
Orders WHERE OrderID = :OrderID INTO :CustID,
:SalesPerson, :Status;
printf ("Customer number: %d n", CustID);
printf ("Salesperson: %s n", SalesPerson);
printf ("Status: %s n", Status);
}
9. Embedded SQL
Connecting to Database using embedded sql
EXEC SQL CONNECT :userid IDENTIFIED BY :passwd;
EXEC SQL CREATE TABLE Test (a int);
EXEC SQL INSERT INTO Test VALUES (1);
EXEC SQL SELECT MAX (a) INTO :value from R;
printf (“Max value=%dn”,value);
10. Cursor
• Can declare a cursor on a query statement which generates a
relation.
• Can open a cursor, repeatedly fetch a tuple, move the cursor,
until all tuples have been retrieved.
• Control order: ORDER BY, in queries that are accessed through
a cursor
• Can also modify/delete tuple pointed to by cursor.
• Must close cursor at end.
11. Cursor
EXEC SQL DECLARE myCursor CURSOR FOR SELECT bid
from Reservations;
EXEC SQL OPEN myCursor;
EXEC SQL WHENEVER NOT FOUND DO break;
while (1) {
EXEC SQL FETCH myCursor INTO :num;
}
EXEC SQL CLOSE myCursor;
12. Dynamic SQL
• Dynamic SQL means composing and executing new (not
previously compiled) SQL statements at run-time.
• Although static SQL statements are relatively easy to
incorporate, Dynamic SQL statements are much more flexible
as they can be constructed at run time.
• Dynamic queries can be complex because the type and
number of retrieved attributes are unknown at compile time.
INSERT INTO EMPLOYEES VALUES (?, ?)
DELETE FROM DEPARTMENT WHERE DEPTID = ?
13. SQLJ
• SQLJ – Standard for embedding SQL in Java
• Similar to existing SQL extensions provided for C, FORTRAN,
and other programming languages.
• IBM, Oracle, and several other companies proposed SQLJ as
a standard and as a simpler and easier-to-use alternative to
JDBC.
• An SQLJ translator converts SQL statements into Java
• These are executed through the JDBC interface
• Certain classes have to be imported E.g., java.sql
14. SQLJ
• SQLJ precompiles SQL code in a Java program.
• Provides greater compile-time checking of SQL statements.
• Reduces the amount of code needed to execute SQL from
within Java.
15. SQLJ v/s JDBC
// SQLJ
int n;
#sql { INSERT INTO emp VALUES (:n)};
// JDBC
int n;
Statement stmt = conn.prepareStatement
(“INSERT INTO emp VALUES (?)”);
stmt.setInt(1,n);
stmt.execute ();
stmt.close();
16. class X {
void myJavaMethod() {
try {
#sql{update EMP set SAL = SAL + 100
where SAL < 1500};
}
SQLJ
import java.sql.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
Imports Needed
SQL statement placed in braces
can throw SQLException
catch (SQLException e) {…}
}
17. SQLJ
Loading the JDBC Driver
SQLJ requires that the JDBC driver class is loaded. This can be
performed in the same way as for JDBC
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch (ClassNotFoundException e)
{
System.out.println("Could not load driver");
}
18. SQLJ
Specifying a Connection Context
• All SQLJ statements execute in a “connection context”
• Plays similar role as a Connection object does in JDBC.
• Establishes the database we are connecting to, the user
name, and the password.
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
DefaultContext.setDefaultContext(new DefaultContext(
"jdbc:oracle:thin:@HOSTID:1521:ORCL",
"theUser", "thePassword") );
}
19. SQLJ
Passing Host Variables into a SQLJ
Statement
• Prefix the java variable name with a colon (:)
#sql {delete from EMP where SAL >= :amt};
20. SQLJ
Dealing with Query Result Sets
• SQLJ can be used to execute queries that return a result set .
• To process the result set, define an “iterator” type that
specifies the data type of each column
#sql iterator MyIter(String ENAME, String JOB);
class MyClass {
MyIter iter;
#sql iter = { select ENAME, JOB from EMP };
while(iter.next()) {
String ename = iter.ENAME();
String job = iter.JOB();
}
21. When to Which ?
How do applications connect to a database?
• App ↔ DBMS: Embedded SQL
• App ↔ Driver ↔ DBMS: JDBC/ODBC or SQLJ
What mechanisms exist to retrieve/modify data?
• Static Queries: Embedded SQL, SQLJ
• Dynamic Queries: JDBC/ODBC, Dynamic SQL
#4: Structured Query Language (SQL) is a standardized language used to manipulate database objects and the data they contain. SQL is comprised of several different statements that are used to define, alter, and destroy database objects, as well as add, update, delete, and retrieve data values. However, SQL is nonprocedural, and therefore is not a general-purpose programming language. (SQL statements are executed by the DB2 Database Manager, not by the operating system.) As a result, database applications are usually developed by combining the decision and sequence control of a high-level programming language with the data storage, manipulation, and retrieval capabilities of SQL. Several methods are available for merging SQL with a high-level programming language, but the simplest approach is to embed SQL
statements directly into the source code file(s) that will be used to create an application. This technique is referred to as embedded SQL programming.
#6: When the preprocessor (a special tool known as the SQL precompiler) encounters these keywords, it replaces the text that follows (until a semicolon (;) or the keywords END-EXEC is found) with a DB2 UDB-specific function call that forwards the specified SQL statement to the DB2 Database Manager for processing.
#7: Host variables that transfer data to a database are known as input host variables, while host variables that receive data from a database are known as output host variables. Regardless of whether a host variable is used for input or output, its attributes must be appropriate for the context in which it is used. Therefore, you must define host variables in such a way that their data types and lengths are compatible with the data types and lengths of the columns they are intended to work with
#8: A declare section can be coded anywhere high-level programming language variable declarations can be coded in a source code file. Although a source code file typically contains only one declare section, multiple declare sections are allowed.
#13: a program accepts SQL statements from the keyboard at run-time.
Generally, dynamic SQL statements are well suited for applications that interact with a rapidly changing database or that allow users to define and execute ad-hoc queries.
#14: JDBC is an API that enables database access from Java programs
#15: SQLJ is passed through a precompiler Checks SQL against the database Generates Java code with JDBC calls