Java in Adaptive Server Enterprise

Peter Kitson

ISBN : -

Order a printed copy of this book from Amazon --UNAVAILABLE--


Cover Design - Java in Adaptive Server Enterprise
 

For your free electronic copy of this book please verify the numbers below. 

(We need to do this to make sure you're a person and not a malicious script)

Numbers

 




Sample Chapter From Java in Adaptive Server Enterprise
     Copyright © Sybase Inc.



Advantages of Java in the database


Adaptive Server provides a runtime environment for Java, which means that Java code can be executed in the server. Building a runtime environment for Java in the database server provides powerful new ways of managing and storing both data and logic.

• You can use the Java programming language as an integral part of Transact-SQL.
• You can reuse Java code in the different layers of your application— client, middle-tier, or server—and use them wherever makes most sense to you.
• Java in Adaptive Server provides a more powerful language than stored procedures for building logic into the database.
• Java classes become rich, user-defined data types.
• Methods of Java classes provide new functions accessible from SQL.
• Java can be used in the database without jeopardizing the integrity,  security, and robustness of the database. Using Java does not alter the behavior of existing SQL statements or other aspects of non-Java relational database behavior.

How can I use Java and SQL together?

A guiding principle for the design of Java in the database is that it provides a
natural, open extension to existing SQL functionality.
• Java operations are invoked from SQL – Sybase has extended the range of SQL expressions to include fields and methods of Java objects, so that you can include Java operations in a SQL statement.
• Java methods as SQLJ stored procedures and functions – you create a SQLJ alias for Java static methods, so that you can invoke them as standard SQL stored procedures and user-defined functions (UDFs).
• Java classes become user-defined datatypes – you store Java class instances using the same SQL statements as those used for traditional SQL datatypes.

You can use classes that are part of the Java API, and classes created and compiled by Java developers.

What is the Java API?

The Java Application Programming Interface (API) is a set of classes defined by Sun Microsystems. It provides a range of base functionality that can be used and extended by Java developers. It is the core of “what you can do” with Java.

The Java API offers considerable functionality in its own right. A large portion of the Java API is built in to any database that is enabled to use Java code— which includes the majority of nonvisual classes from the Java API already familiar to developers using the Sun Microsystems JDK.