Examination of database system engineer (cast quoted Jade)

Source: Internet
Author: User
Tags interface odbc sql query sybase database table name access oracle database
Data | Database afternoon test objective is to test the ability to test the "universality" of things, and try to avoid "particularity." In other words, the exam should not be subject to the individual special knowledge background of the candidates too much influence. This is just like the elevation test. Even the program design, as well as the choice of C/s + +, that is, take care of the different, examinee's knowledge background, this is fair.
My personal opinion is, in the afternoon exam, there is a data flow diagram, E-R diagram, case analysis and design, database design, SQL, UML, such as the possibility is relatively large, and these concepts may also be in the examination.

Overview of the JDBC Basics tutorial

1.1 What is JDBCTM?

JDBCTM is a JAVATM API for executing SQL statements (interestingly, JDBC itself is a trademark name rather than an abbreviation; however, JDBC is often considered to represent "Java database connections" (Java data
Base connectivity) "). It consists of a set of classes and interfaces written in the Java programming language. JDBC provides tools/database developers with a standard API that enables them to write database applications with a pure Java API
Order.

With JDBC, it's easy to send SQL statements to various relational databases. In other words, with the JDBC API, you don't have to write a program specifically to access the Sybase database, and write a program to access the Oracle database.
To access the Informix database and write another program, and so on. Suffice it to write a program with the JDBC API to send SQL statements to the appropriate database. Also, applications written in the Java programming language do not need to worry about different
platform to write different applications. Combining Java with JDBC will allow programmers to write the program once and let it run on any platform.

Java is robust, secure, easy-to-use, easy to understand, and automatically downloadable from the Web, and is an excellent language for writing database applications. All you need is a way for the Java application to talk to a variety of different databases. And JDBC is doing this
mechanism of use.

JDBC extends the functionality of Java. For example, a Web page containing applets can be published with the Java and JDBC APIs, and the information used by the applet may be from a remote database. Enterprises can also use JDBC to pass int
Ranet connects all employees to one or more internal databases (even if they use computers with various operating systems such as Windows, Macintosh, and UNIX). As more and more programmers begin to use Java programming language
, the need for easy access to the database from Java is also increasing.

MIS administrators like the combination of Java and JDBC because it makes it easy and economical to spread information. Organizations can continue to use their installed databases and access information easily, even if they are stored on different database management systems. Development of new Programs
Period is very short. Installation and versioning will be greatly simplified. Programmers can write only one application or update it once, and then put it on the server, and then anyone can get the latest version of the application. For business sales information Services, Java and JDBC are available for external customers
Provides a better way to get information updated.



ODBC (Open database connectibvity) is a widely accepted application programming interface for database access. For the database API, it is x/open and ISO/IEC call-level inte
Rface (CLI) specification and uses Structured Query Language (SQL) as its database access language. ODBC is designed for maximum interoperability, the ability of an application to access different database management systems (DBMS) with the same source code. Database application
The program invokes the function in the ODBC interface, which is implemented in a database-specific module called a driver. The use of the driver isolates the application from the specific database call, which separates the word processor from the specific printer command by the printer driver
Kind of. Because the driver is loaded at run time, users need only add a new driver to access the new DBMS, and there is no need to recompile or relink the application


Guessing the fifth question of the afternoon exam

All the basic features of JDBC, now we can write a simple program that opens the database, prints its table name and the contents of a table column, and then executes the query against the database. The program looks like this:




Import java.sql.*;
public class Jdbcodbc_test {
ResultSet results;
ResultSetMetaData RSMD;
DatabaseMetaData DMA;
Connection con;
Public Jdbcodbc_test () throws SQLException {
String url = "Jdbc:odbc:Northwind";
try {
Load JDBC-ODBC Bridge Driver
(————————————————————);
Con = (————————————);//Connect database
DMA = (————————————);//Get the metadata of the database
System.out.println ("Connected to:" + dma.geturl ());
System.out.println ("Driver" + dma.getdrivername ());
catch (Exception e) {
System.out.println (e);
}
try {
Statement stmt = (————————————)
Results = (———————————) resultsetmetadata (————————————) int cols = (————————————)
String resultrow = "";
for (int i = 1; i < cols; i++) {
Resultrow + + + resultmetadata.getcolumnname (i) + ";";
}
System.out.println (Resultrow);
while (————————————) {
Resultrow = "";
for (int i = 1; i < cols; i++) {
try {
Resultrow + + = (————————————) + ";";
catch (NullPointerException e) {
System.out.println (E.getmessage ());
}
}
System.out.println (Resultrow);
}
catch (Exception e) {
SYSTEM.OUT.PRINTLN ("Query exception");
finally {
(————————————)
}
}
}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.