Welcome to my “Database developer.”
DB2 Express-C on Linux® and Windows® platforms (32-bit and 64-bit) is available for free download from IBM. IBM launched DB2 Express-C on January 1, 2006, a version of DB2 Universal Database Express Edition (DB2 Express). It provides a stable database environment for building and deploying C / C ++, Java,.NET, PHP, and other applications.https://www.blogger.com
Both IBM Cloudscape ™ and Express-C are available for free from IBM and can be used to develop and deploy applications. Because both database servers are based on open standards such as SQL and JDBC, it is easy to migrate Java applications and databases between them. Although DB2 Express-C has a larger download and disk footprint than Cloudscape, DB2 offers more tools. It also offers more features, such as full support for .NET applications, but also for PHP applications. DB2 Express-C can utilize up to two CPUs and 4GB of memory, and the size of the database is unlimited. DB2 allows a single database to span as many disks as possible to improve scalability and performance.
DB2 Express-C is a production-ready database server that follows the innovations of continuously evolving DB2 products on Linux and Windows. DB2 has been available on Windows since 1995, and the Linux version has been available since 1999. If you are interested in the history of DB2, it is recommended to read the article "Overview Map: IBM DB2 Universal Database and Information Management" (developer Works, January 2003).
You might ask, "What if the database server needs more than 4GB of memory and more than two CPUs to support my application?" In this case, it's easy to migrate to Linux, Windows or UNIX ® UDB Enterprise Server Edition (ESE). DB2 ESE optionally adds a Database Partitioning Feature (DPF) to perform parallel database operations. Migrating from DB2 Express-C to other DB2 versions is easy because their core database engines are the same.
With the introduction of DB2 Express-C, IBM has also introduced a new interactive forum where DB2 experts from IBM can help you. If you have any questions about this new free data server, you can find answers here. DB2 Express-C has a complete set of manuals in PDF format and is also available on the DB2 Information Center, a comprehensive searchable Web site. The DB2 Information Center is continuously updated, and you can download the latest version of the DB2 Information Center and install it on a dedicated server, or get all the DB2 UDB product manuals. Note that the DB2 Information Center is common to all DB2 UDB versions on Linux, UNIX, and Windows, so be aware that some advanced features, such as Database Partitioning Feature (DPF), cannot be applied to a DB2 Express-C environment.
If you plan to use DB2 Express-C on Linux, it is best to check for the latest tested Linux distributions. Another reference on DB2 for Linux is DB2 Universal Database Version 8.2 for Linux HOWTO.
Set up and running
Install DB2 Express-C
The minimum memory requirement for DB2 Express-C is 256MB (without graphical tools) or 512MB (with graphical tools). The machine used in this article has more than 2GB of memory. For this article, I downloaded DB2 Express-C for Windows (32-bit). This download pack has 391MB, the installation is very simple. After unzipping the zip file (there are not many directories on my system, only 412MB), execute the executable setup. This starts the DB2 Express Launchpad, as shown in Figure 1. The problem asked by this graphical installer is only where DB2 Express-C is installed and the user id and password of the DB2 Administration Server. I performed a typical installation, which includes development tools and libraries. The entire installation takes less than four minutes.
A typical installation of DB2 Express-C provides the drivers and interfaces needed to develop C / C ++, Java, and .NET applications. If you want to develop PHP or Perl applications for DB2, there are also PHP and Perl drivers available. These PHP and Perl interfaces are developed and maintained by engineers in the DB2 team. DB2 supports many kinds of database server-side programming languages, including stored procedures, triggers, and functions (table functions and scalar functions). DB2 stored procedures can be written in C / C ++, COBOL, Java (JDBC or SQLJ), .NET (CLR Compatible Language), and SQL Procedure Language (SQL PL). The stored procedure language is chosen by the developer; however, the languages most commonly used are Java and SQL PL.
SQL Procedure Language (SQL PL) stored procedures are considered native because they are stored as objects in a DB2 database on Linux and Windows. SQL PL has evolved into the only ANSI SQL-based stored procedure language. SQL PL is supported on all DB2 database servers on Linux, UNIX, Windows, iSeries, and z / OS. In Figure 14, use the DB2 Development Center to build, test, and deploy the SQL PL process. The process shown here is called high rollers; it provides a simple technique for controlling user access to DB2.
Java
Developing Java applications for DB2 is easy because each DB2 client and server provides a JDBC 4 compatible (type 4) driver. In fact, DB2 currently contains two different JDBC drivers. Depending on the architecture, the original driver (db2java.zip) is sometimes called the Application (Type 2) and Network (Type 3) drivers. The more flexible new JDBC driver (db2jcc.jar) can be used in either type 2 or type 4 mode and is already in use with the latest Java client/server industry benchmarks such as SPECjAppServer 2004 for DB2 and Web Sphere® Application Server (See "Reference"). DB2's JDBC driver (db2jcc.jar) is bound in the DB2 Run-time client. If the application is pure Java, then put db2jcc_license_cu.jar and db2jcc.jar into the CLASSPATH. These files are located in the <DB2 Installation location> \ SQLLIB \ java directory. Java 2 Platform Enterprise Edition (J2EE) servers, such as IBM Web Sphere Application Server, and DB2 data servers provide a mission-critical distributed application architecture that supports scalable applications.
PHP
PHP has been widely used to develop scalable web applications. DB2 support for PHP developers has recently been enhanced with the addition of DB2 native PHP extensions (see Resources) supported by IBM. PHP is an open source scripting language that has driven the development of millions of web applications and has been evolving since 1995. The DB2 PHP extension is also open source. If you want to use this extension on Windows, and do not want to compile the code, you can also find the necessary Windows library.
The easiest way to set up a DB2 environment and run PHP is to download the free Zend Core ™ for IBM developed by IBM and Zend Technologies. Zend Core for IBM is a PHP development and production environment that tightly integrates with DB2 (IBM Cloudscape database server). It provides the foundation for rapid development and deployment of database-driven applications. Zend Core for IBM's support options is also available from Zend Technologies if you need a fully supported web technology portfolio that includes PHP support and DB2 support. Zend Core for IBM embeds a free version of the Cloudscape database server and DB2 Express, which simplifies deployment. You can also get support for bundled DB2 Express products if you decide later to purchase a full DB2 Express Edition license. In Figure 15, the Zend Core for IBM Management Web Console shows that the DB2 PHP native extensions have been correctly configured.
C / C ++ and more
DB2 Express-C provides two main C APIs for data access - DB2 CLI and Embedded SQL. The most commonly used C / C ++ API today is the DB2 Call Level Interface (CLI), which is based on the X / Open CLI standard. This API is similar to the Microsoft ODBC (Open Database Connectivity) API used in many Windows applications. If SQL statements are already defined during application development, Embedded SQL works well because SQL is verifiable, creating and locking access plans during development, which improves application performance. However, SQL statements are often dynamic, in which case dynamic SQL access techniques such as the DB2 CLI API are more appropriate.
DB2 Express-C offers many other options for developers, including COBOL, Perl, and Python. Perl drivers are available from the open source Perl community, which is maintained and supported by IBM. SourceForge.net provides an updated DB2 Python driver (see Resources). Perl, PHP, and Python drivers require a valid DB2 Run-time client for deployment and a DB2 Application Development Client (or a full DB2 Express-C) installation that compiles and builds the application.
Deployment guidance
There are some things to keep in mind when deploying a database application, including:
Install DB2 server
Install DB2 client
Deploy the application itself
Deploy the database
Installing a DB2 server environment can be done using the DB2 graphical installer (db2setup on Linux / setup on Windows) or a response file (db2setup -R on Linux / setup / U <file-name> on Windows) Perform an automatic installation.
The DB2 Run-Time Client provides all the application programming interfaces (APIs) and network client drivers required to directly access DB2 on Linux, UNIX, or Windows. Deploying the application is beyond the scope of this article, but you need to ensure that your application has the required DB2 client access libraries. Deploying the database itself can be done using a DB2 backup image or the database can be reconfigured from the data digest to load the file. Make sure that any objects your application depends on, such as stored procedures, triggers, views, and user-defined functions, are properly defined and accessible.
Operating instructions
DB2 Express-C uses the same core database server technology as all DB2 servers on Linux, UNIX, and Windows, and many of the features introduced in DB2 UDB V8.1 and V8.2 greatly simplify DBA monitoring, tuning, and management of DB2 Server operation task. DB2 DBAs (database administrators) tend to manage very large DB2 systems or many DB2 servers scattered across large organizations. Self-management and self-tuning capabilities in DB2 Express-C help manage large enterprise DB2 deployments, so using DB2 Express-C database servers requires only basic DB2 DBA skills to maintain high application availability.
About Cloudscape
Cloudscape is a pure Java database server that is well suited as an embedded database engine for Java applications or for small and medium-sized Web applications. Cloudscape V10 was originally a free database server released by IBM in 2004. In the meantime, the Apache Derby Project, which uses the same code base, has been launched as a hatcher for the Apache Software Foundation. (For more information on the Apache Derby Project, see Resources). Cloudscape V10.1 released an update in August 2005. Prior to the release of the new Cloudscape 10.1, the Derby Project in the Apache Software Foundation ended the incubation phase and is now part of the top-level Apache DB project.
No comments:
Post a Comment