tailieunhanh - Ebook An introduction to network programming with Java (3/E): Part 2
Part 2 book “An introduction to network programming with Java” has contents: Java database connectivity, servlets, javaserver pages, javabeans, multimedia, applets. Invite reference you. | Chapter 7 Java Database Connectivity (JDBC) Learning Objectives After reading this chapter, you should: • be aware of what JDBC is and why it is needed; • be aware of the differing versions of JDBC that are associated with the differing versions of Java; • know how to use JDBC to make a connection to a database by employing Java’s DriverManager class; • know how to make use of the JDBC-ODBC bridge driver; • know how to use JDBC to execute SQL queries and updates and how to handle the results returned; • know how to use Apache Derby/Java DB to create and manipulate a relational database table; • know how to carry out transaction processing via JDBC; • know how to use JDBC to find out structural information about databases; • know how to make use of a JTable to format the results of a database query; • know how to use JDBC to move freely around the rows returned by a query; • know how to use JDBC to modify databases via Java methods; • know how to use JDBC to make a connection to a database by employing Java’s DataSource interface; • be aware of the advantages that the use of the DataSource interface has over the use of the DriverManager class. The previous three chapters employed individual, ‘flat’ files to provide persistent data storage. Nowadays, of course, most organisations have the bulk of their data structured into databases, which often need to be accessed from more than one site. These databases are almost invariably relational databases. Programs written in Java are able to communicate with relational databases (whether local or remote) via the Java Database Connectivity (JDBC) API, which became part of the core Java distribution with JDK . In this chapter, we shall consider how such databases may be accessed via JDBC. J. Graba, An Introduction to Network Programming with Java: Java 7 Compatible, DOI , © Springer-Verlag London 2013 179 180 7 Java Database Connectivity (JDBC) The Vendor .
đang nạp các trang xem trước