欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    jdbc(数据库连接)-外文翻译及原文设计论文.doc

    • 资源ID:91478399       资源大小:76KB        全文页数:13页
    • 资源格式: DOC        下载积分:12金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要12金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    jdbc(数据库连接)-外文翻译及原文设计论文.doc

    (此文档为word格式,下载后您可任意编辑修改!)JDBC (Java Data Base Connectivity)JDBC (Java Data Base Connectivity,) is a SQL statement for the implementation of the Java API, for a variety of relational databases to provide a unified visit by a group, its using Java language preparation classes and interface. JDBC for tools / database development provides a standard API, which can build more sophisticated tools and interfaces to database developers. Pure Java API can be used to prepare database applications, at the same time, JDBC is also a brand name. With JDBC, data sent to the various relationships SQL statement is a very easy matter. In other words with JDBC API, we do not have to visit a Sybase database to write specialized procedures, visit the Oracle database specifically to write a program, or visit Informix database and the preparation of another procedure, programmers should use the JDBC API to write a procedure enough, it can be sent to the corresponding SQL database calls. Meanwhile, the Java language and JDBC to integrate non-programmers do not have to, with a platform for the preparation of different applications, just write it again in the process can be run on any platform, which is the Java language "Write once, run everywhere" advantage. Java database Connect Architecture for Java application of the standard method of connecting to the database. JDBC is the case of Java programmers API, and the realization of the database connection is the case of service providers interface model.As API, JDBC program development for the provision of standard interfaces, and database vendors and third-party middleware vendors to achieve connectivity and database provides a standard method. JDBC use the existing SQL standard - Support and other databases and connectivity standards, such as bridge between ODBC. JDBC achieve all these objectives and standards for a simple, high-performance and strict definition of achieving type interface. Java with a solid, safe, easy to use, easy to understand and can be automatically downloaded from the Internet and other characteristics of the preparation of the outstanding database application language. Need is a Java application Database with a variety of different procedures for a dialogue between the methods. The JDBC is the mechanism for such purposes. Java JDBC expanded functionality. For example, with Java and JDBC API Applet can be issued containing the page, and the applet may use the information from remote databases enterprises can also use JDBC to all staff through the Intranet will be connected to one or more Internal database (even if those staff computers are used by Windows, Macintosh, and UNIX, and other various operating systems). As more and more programmers using Java Programming language, Java from the convenient access to the database requirements are increasing. MIS administrators like the combination of Java and JDBC, because it makes it easy to disseminate information and Economy. Enterprises can continue to use their installed database, and can easily access information, even if this information is stored in the different database management systems. The development of new procedures is a very short period. An Equipment and version control will be greatly simplified. Programmers can prepare only what applications or updated only once, and then put it on the server, and then on any person can get the latest version of the application. Sales for the business information services, Java and JDBC for external customers with better access to information update method.First, the use of JDBC Simply put, JDBC to do three things: establish a connection with the database, send SQL statements and the results. The following codes are the basic examples:Connection con = DriverManager.getConnection ( "jdbc: odbc: wombat," "login""Password");Statement stmt = con.createStatement ();ResultSet rs = stmt.executeQuery ( "SELECT a, b, c FROM Table1");While (rs.next () Int x = rs.getInt ( "a");String s = rs.getString ( "b");Float f = rs.getFloat ( "c");Based on the above code JDBC database access to a summary of the classic, of course, in this part of the follow-up section we will do a detailed analysis.Second, JDBC API JDBC is a "low-level" interface, that is, it calls for direct SQL commands. In this respect it functions very good, and other than the easy-to-use database connectivity API, but it also has been designed as a basis interface, it can be established on the High interface and tools. High interface is "user-friendly" interface, which uses a more comprehensible and more convenient API. This API is converted in the behind-the-scenes such as JDBC such a low-level interface. In the relational database "object / relationship" mapping, each row in the table corresponding to the category of an example, the value of each column the examples should be an attribute. Therefore, programmers can directly operate on the Java objects; SQL for data access call will be "under the guise of" automatically generated. They can also be more complex mapping, for example, a number of rows in the table integrated into a Java class. With the interest of the people of JDBC the growing, and more and more developers have been using JDBC-based tools So that the preparation process more easily. Programmers has been trying to make in the preparation of end-user database access has become more simple applications. For example, applications can provide a choice of According to the mandate of the menu. Task was chosen, the application will be given tips and blank selected for the task of completing the implementation of the necessary information. Application procedures for the importation of the required information will automatically call for SQL Order. In such a process with the assistance, even if they do not understand the fundamental SQL syntax, but also can perform database tasks.Third, JDBC and ODBC compared with other API Currently, Microsoft's ODBC API is the most widely used for the visit of the relational database programming interface. It can connect almost all platforms almost all databases. For What Java does not use ODBC? The answer to this question is: Java can use ODBC, but preferably with the help of the JDBC to JDBC-ODBC Bridge in the form of use of this point, we later say. The problem now has become: "Why do we need JDBC?" The answer is clear: ODBC not suitable for direct use in Java, because it uses C language interface. Transferred from Java C code in the local security, achieved solid and procedural aspects of the automatic transplantation has many shortcomings. From ODBC C API Java API to the literal translation is not advisable. For example, Java does not guide, and it has ODBC indicators used very widely (including very error-prone Guidelines "void *"). You can imagine JDBC will be converted into the object-oriented interface to the ODBC, and the object-oriented interface to make it easier for Java programmers to receive. ODBC is difficult to learn. It simple and advanced features of the mix, and even the simple query, the options are extremely complex. On the contrary, JDBC to guarantee simple function of simplicity, At the same time, if necessary, to allow the use of advanced features. The opening of "pure Java" mechanism needs such as JDBC Java API. If you use ODBC, it is necessary to manually will be ODBC driver management and driver installation in each client machines. If completely written in Java JDBC Driver in all the JDBC code on the Java platform (from the computer network to the mainframe) can be Automatic installation, and guarantee the safety of transplantation.In short, JDBC API for SQL abstract and basic concepts of Java is a natural interface. It is built on ODBC rather than starting from scratch. Therefore, programmers will be familiar with ODBC JDBC found very easy to use. ODBC JDBC retains the basic design features; In fact, the two interfaces are based on the X / Open SQL CLI (call-level interface). Among them the largest district, another is: Java JDBC to style and based on the merits and optimization, more easy to use.At present, Microsoft has introduced a new addition to ODBC API: RDO, ADO and OLE DB. These design in many ways and JDBC is the same, that is, they are the object-oriented Based on the database interface and can be achieved on ODBC in the category. But the interface, we did not see any special features that make their choice we need to turn to alternative ODBC, especially in the ODBC Flooding Has been established procedure for better market conditions. They also is the largest in the ODBC add a decoration only.Forth, JDBC on the B / S and C / S mode supportJDBC API supports both the two-tier model of database access (C / S), but has also supported the three-tier model (B / S). In the two-tier model, Java applet or application will be directly into the database to dialogue. This will require a JDBC driver to visit with the specific database management systems to communicate. Users of SQL statements sent to the database, and its results will be returned to user. Database can be located on another computer, users connected to the above network. This is called client / server configuration, user's computer for the client, providing database computing Machines for servers. Intranet network can be (it can be linked to company staff), it can also be an internet.In the three-tier model, the order was first sent to the "middle layer", and then by the SQL statement it sent to the database. Database on SQL statement processed and the results sent back to the middle Layer, the middle layer then the results returned to users. MIS managers have discovered the three-tier model is very attractive, because the middle layer can be used to control access to company data and can be used for the newer types. In Another advantage of inter-layer, the user can use the easy-to-use high-level API, and the middle layer will be converted to its corresponding low-level calls. Finally, in many cases under the three-tier structure can provide some performance on the benefits.So far, the middle layer are usually in C or C + + language to prepare such, the implementation of these languages faster. However, with the most optimized compiler (it to switch to Java byte code Efficient in the specific machine code) the introduction, use Java to achieve middle layer will be more practical. This will be a big step forward, it enables people to take full advantage of the many Java Advantages (such as robust, multi-threaded, and security features). For Java JDBC from the middle layer to access a database is very important. Fifth, SQL consistencyStructured Query Language (SQL) relational database access is the standard language. The tricky part is: Although most of the DBMS (database management system) to use the basic functions Standard forms of SQL, but they are not consistent with the recent higher standard definition of the functions of SQL syntax or semantics. For example, not all databases support stored procedures or external connections, it More support this function in the database and mutually inconsistent. It is hoped that the SQL standard that the real part to expanding to include more and more functions. But at the same time it must support JDBC API With the existing SQL.JDBC API solution to this problem is to allow a way for any string has been reached by the driver on the DBMS. This means that applications can use any number of SQL Functional, but it must take the risk: it is possible in some DBMS errors. In fact, applications for SQL even if not, or that it may be for a specific DBMS Design SQL dedicated derivatives (for example, documents or images enquiries). JDBC deal with the issue of consistency SQL second method is to provide ODBC-style escape clause, which will in the follow-up Part of the discussion. Escape for a few common grammatical differences SQL provides a standard syntax JDBC. For example, the date has been stored text and the process of calling all escaped grammar. For complex Miscellaneous applications, JDBC third method used to deal with the issue of consistency in its SQL Database Meta Data interface to use DBMS on the description of information, thus enabling application - Each DBMS order to adapt to the requirements and functional. As JDBC API will be used to develop advanced tools and database access API, API basis, it must also pay attention to all of its superstructure consistency. "TM with JDBC standards," representatives of the JDBC users can rely on the standard-level functions. To use this statement, the driver must be at least support the ANSI SQL-2 Entry Level (ANSI SQL-2 represent the United States National Bureau of Standards in 1992, the standards adopted. Entry Level SQL functions on behalf of a specific list). Driver developers can be carried by the JDBC API Testing kits to determine whether the driver of their compliance with these standards. "TM with JDBC standards," said the JDBC providers have been adopted to achieve the Java Soft the conformance testing. These tests will check the consistency of the definition of JDBC API all the classes and methods exist, as far as possible, to check whether the procedures SQL Entry Level function. Of course, these tests not entirely, but now has no intention of Java Soft the various providers to the realization of superscript level. However, this definition of consistency can indeed achieve the JDBC provide a certain degree of credibility. As more and more Database providers, connecting providers, Internet providers and application programming Members of the JDBC API acceptance, JDBC is also rapidly becoming the standard Java database access.Sixth, JDBC entrance - Establishment of connection You need to do the first thing is you want to use the DBMS and the establishment of a connection. This includes two steps: loading drivers and establish a connection. Loading drivers Loading drivers need only a very simple line code. For example, you want to use JDBC-ODBC Bridge Driver, loading it with the following code:Class.forName ( "sun.jdbc.odbc.JdbcOdbcDriver"); Document your driver will tell you should use the class name. For example, if the category were jdbc.DriverXYZ, you will be used to code the following code loading drivers: Class.forName ( "jdbc.DriverXYZ"); You do not need to create an instance of the class driver and register it with DriverManager, because calls will be automatically loaded Class.forName Driver category. If you had to create their own examples, you will create an unnecessary copy, but it will not do any harm. Loading Driver category, they can be used to connect with the database. Connection The second step is to use the appropriate driver of the establishment of a connection with the DBMS. The following code is the general practice:Connection con = DriverManager.getConnection (url, "myLogin", "myPassw

    注意事项

    本文(jdbc(数据库连接)-外文翻译及原文设计论文.doc)为本站会员(红****)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开