CN102053823A - Method and device for connecting Java information platform and MySql database - Google Patents

Method and device for connecting Java information platform and MySql database Download PDF

Info

Publication number
CN102053823A
CN102053823A CN2009101977643A CN200910197764A CN102053823A CN 102053823 A CN102053823 A CN 102053823A CN 2009101977643 A CN2009101977643 A CN 2009101977643A CN 200910197764 A CN200910197764 A CN 200910197764A CN 102053823 A CN102053823 A CN 102053823A
Authority
CN
China
Prior art keywords
database
login
jdbc
information platform
programming interfaces
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2009101977643A
Other languages
Chinese (zh)
Inventor
黄翼飞
张丽晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sanda University
Original Assignee
Sanda University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanda University filed Critical Sanda University
Priority to CN2009101977643A priority Critical patent/CN102053823A/en
Publication of CN102053823A publication Critical patent/CN102053823A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method and a device for connecting a Java information platform and a MySql database. The method comprises the following steps of: providing an interface for logging in the MySql database, wherein the interface is provided for a user of the information platform to log in the database; and after login of the user, establishing a connection between the database and a corresponding driver, sending structured query language (SQL) statements to the database, and processing results returned by the database.

Description

The Java information platform connects the method and the device of MySql database
Technical field
The present invention relates to field of information system, particularly a kind of Java information platform connects the method and the device of MySql database.
Background technology
Along with making rapid progress of technology, simple use data base administration data can not satisfy the demands, how can more effective use database, select to be fit to the database in own field, and how can more effectively inquire about, revise data, and adding rapid development of network, the memory space on the website is also increasing, the problem of accumulating over a long period of the information processing that these caused all is the huge challenge that database development is now faced.
The semi-invariant of the database data of many business and governments department inside is increasing, and the phenomenon of information island is also more and more serious, and these have hindered infosystem and have further developed.Data between infosystem and each database need exchange at any time, and this becomes one than exigence with regard to the technology that makes information platform connect database.
Summary of the invention
The purpose of this invention is to provide method and device that a kind of Java information platform connects the MySql database, it can realize that the Java information platform is connected with the smooth and easy of MySql database.
On the one hand, the invention provides the method that a kind of Java information platform connects the MySql database, may further comprise the steps:
1.1, the interface of the described MySql database of a login is provided, login described database for the user of described information platform;
1.2, after the described user login, between described database and corresponding driving program thereof, connect;
1.3, send SQL statement to described database, and the result that returns of processing said data storehouse.
Described step 1.2 and step 1.3 are finished by the application programming interfaces JDBC of Java database.
Described step 1.2 acts between application program and the database device by the Driver Manager class of described application programming interfaces JDBC, connects between database and corresponding driving program thereof.
Described step 1.3 sends to SQL statement in the database by the Statement object according to described application programming interfaces JDBC, by the result of ResultSet class loading data library inquiry.
On the other hand, the present invention also provides a kind of Java information platform to connect the device of MySql database, comprising:
User authentication unit in order to the interface of the described MySql database of a login to be provided, supplies the user of described information platform to login described database;
Linkage unit connects between described database and corresponding driving program thereof in order to login the back described user;
Performance element, in order to sending SQL statement to described database, and the result that returns of processing said data storehouse.
Described linkage unit and performance element are realized by the application programming interfaces JDBC of Java database.
Described linkage unit acts between application program and the database device by the Driver Manager class of described application programming interfaces JDBC, connects between database and corresponding driving program thereof.
Described performance element sends to SQL statement in the database by the Statement object according to described application programming interfaces JDBC, by the result of Result Set class loading data library inquiry.
Adopt a kind of Java information platform of the present invention to connect the method and the device of MySql database, it provides the interface of the described MySql database of a login, user for described information platform logins described database, and after user's login, between described database and corresponding driving program thereof, connect, send SQL statement to described database again, and the result that returns of processing said data storehouse.
Description of drawings
Fig. 1 is the process flow diagram of the method for the invention.
Fig. 2 is the theory diagram of device of the present invention.
Embodiment
Further specify technical scheme of the present invention below in conjunction with drawings and Examples.
At first introduce the MySQL database, it is a kind of Relational DBMS (RDBMS) of open source code, and the MySQL Database Systems use that the most frequently used database management language--Structured Query Language (SQL) (SQL) is carried out data base administration.Because MySQL is an open source code, so anyone can download under permission and according to the needs of personalization it be made amendment.MySQL receives much concern because of its speed, reliability and adaptability.The MySQL relevant database is issued first version in January, 1998.The multi-thread mechanism that its using system core provides provides multithreading operational mode completely, provide towards the DLL (dynamic link library) (APIs) of programming languages such as C, C++, Eiffel, Java, Perl, PHP, Python and Tcl, supported multiple field type and SELECT and WHERE operation in the complete operational character support inquiry are provided.The MySQL4.0 version is announced in the plan of MySQL development group mid-term calendar year 2001.In this version, will there be following new characteristic to be provided: new table definition file layout, high performance data copy function, more powerful full-text search function.After this, MySQL is developing and is being desirable to provide that safe data copying machine system, the MySQL on BeOS operating system realize and to the periodic refresh option of time-delay key word.Along with the propelling of time, MySQL will be compatible fully to ANSI 92/ANSI 99 standards.
Referring to Fig. 1, Fig. 1 is the method 100 that a kind of Java information platform of the present invention connects the MySql database, may further comprise the steps:
101, the interface of the described MySql database of one login is provided, supplies the user of described information platform to login described database.
102, after described user's login, between described database and corresponding driving program thereof, connect.
As an embodiment, described step 102 and step 103 are finished by the application programming interfaces JDBC of Java database.Described step 102 acts between application program and the database device by the Driver Manager class of described application programming interfaces JDBC, connects between database and corresponding driving program thereof.
103, send SQL statement to described database, and the result that returns of processing said data storehouse.
As an embodiment, described step 103 sends to SQL statement in the database by the Statement object according to described application programming interfaces JDBC, by the result of ResultSet class loading data library inquiry.
Below detailed introduce implementation procedure of the present invention:
The interface of a described MySql database of login at first will be provided, also can be called linkage interface, can be a JDialog dialog box, as long as the user inputs the password that is provided with when MySql is installed, just can login MySql database (general default username and password all are " root "), below be the code of the demonstration of this JDialog:
Figure B2009101977643D0000041
The major function that code is realized is to show login interface, and some sizes as the whole dialogue frame is set, position, the basic setting of base attribute etc.
The present invention realizes and being connected of database server that by utilization JDBC technology JDBC (Java DataBase Connectivity) is a Java database connection API (application programming interfaces), and briefly, JDBC can finish following three things:
(1) connects with a database.The DriverManager class acts between application program and the database device, and it is used for loading driver, and connects between database and corresponding driving program thereof.
(2) send SQL statement to database.The Statement object is used for SQL statement is sent to database, the inquiry in the process database.
(3) result that returns of process database.The ResultSet class is mainly used in the result of loading data library inquiry.And in argumentation of the present invention, what mainly apply to is to connect with database, i.e. the utilization of DriverManager class.
All will import the jar bag when utilization JDBC connects database, what install here is that the jar bag that therefore MySql5.0 imports is MySql-connector-java-5.0.4-bin.jar.Below for connecting the core sentence of database:
Figure B2009101977643D0000051
The code introduction be the name of the class of the connection that imports, be connected with testing, the url that obtains connecting, user name and password, the localhost here and 3306 be default setting when installation database all.When input after username and password finishes, click the login button, if successful connection then can jump to operation interface, if failure then can display reminding, the user is the disabled user, please check user name, password or tables of data etc.
Referring to Fig. 2, on the other hand, the present invention also provides a kind of Java information platform to connect the device 200 of MySql database, comprising:
User authentication unit 210 in order to the interface of the described MySql database of a login to be provided, supplies the user of described information platform to login described database.
Linkage unit 220 connects between described database 240 and corresponding driving program thereof in order to login the back described user.
Performance element 230, in order to sending SQL statement to described database 240, and the result that returns of processing said data storehouse 240.
As an embodiment, described linkage unit 220 and performance element 230 are realized by the application programming interfaces JDBC of Java database 240.Described linkage unit 220 acts between application program and the database device by the Driver Manager class of described application programming interfaces JDBC, connects between database 240 and corresponding driving program thereof.Described performance element 230 sends to SQL statement in the database 240 by the Statement object according to described application programming interfaces JDBC, by the result of ResultSet class loading data storehouse 240 inquiries.
It is to be noted, the device 200 that a kind of Java information platform of the present invention connects the MySql database is connected the method 100 of MySql database with described a kind of Java information platform, both are identical or similar on principle and embodiment, so repeating part repeats no more.
Those of ordinary skill in the art will be appreciated that, above embodiment is used for illustrating the present invention, and be not to be used as limitation of the invention, as long as in connotation scope of the present invention, all will drop in claims scope of the present invention variation, the modification of above embodiment.

Claims (8)

1. the method for a Java information platform connection MySql database is characterized in that, may further comprise the steps:
1.1, the interface of the described MySql database of a login is provided, login described database for the user of described information platform;
1.2, after the described user login, between described database and corresponding driving program thereof, connect;
1.3, send SQL statement to described database, and the result that returns of processing said data storehouse.
2. the method for claim 1 is characterized in that, described step 1.2 and step 1.3 are finished by the application programming interfaces JDBC of Java database.
3. method as claimed in claim 2, it is characterized in that, described step 1.2 acts between application program and the database device by the Driver Manager class of described application programming interfaces JDBC, connects between database and corresponding driving program thereof.
4. method as claimed in claim 3 is characterized in that, described step 1.3 sends to SQL statement in the database by the Statement object according to described application programming interfaces JDBC, by the result of ResultSet class loading data library inquiry.
5. the device of a Java information platform connection MySql database is characterized in that, comprising:
User authentication unit in order to the interface of the described MySql database of a login to be provided, supplies the user of described information platform to login described database;
Linkage unit connects between described database and corresponding driving program thereof in order to login the back described user;
Performance element, in order to sending SQL statement to described database, and the result that returns of processing said data storehouse.
6. device as claimed in claim 5 is characterized in that, described linkage unit and performance element are realized by the application programming interfaces JDBC of Java database.
7. device as claimed in claim 6, it is characterized in that, described linkage unit acts between application program and the database device by the Driver Manager class of described application programming interfaces JDBC, connects between database and corresponding driving program thereof.
8. device as claimed in claim 7 is characterized in that, described performance element sends to SQL statement in the database by the Statement object according to described application programming interfaces JDBC, by the result of ResultSet class loading data library inquiry.
CN2009101977643A 2009-10-27 2009-10-27 Method and device for connecting Java information platform and MySql database Pending CN102053823A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101977643A CN102053823A (en) 2009-10-27 2009-10-27 Method and device for connecting Java information platform and MySql database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101977643A CN102053823A (en) 2009-10-27 2009-10-27 Method and device for connecting Java information platform and MySql database

Publications (1)

Publication Number Publication Date
CN102053823A true CN102053823A (en) 2011-05-11

Family

ID=43958183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101977643A Pending CN102053823A (en) 2009-10-27 2009-10-27 Method and device for connecting Java information platform and MySql database

Country Status (1)

Country Link
CN (1) CN102053823A (en)

Similar Documents

Publication Publication Date Title
JP7271734B2 (en) Data serialization in distributed event processing systems
US9870202B2 (en) Business object model layer interface
US8260824B2 (en) Object-relational based data access for nested relational and hierarchical databases
US20170116282A1 (en) Supporting pluggable databases with heterogeneous database character sets in a container database
US9646041B2 (en) Testing of inactive design-time artifacts
US7822710B1 (en) System and method for data collection
KR101376916B1 (en) Techniques to perform gradual upgrades
US20110238709A1 (en) Extending database tables in a multi-tenant environment
EP3751426A1 (en) System and method for migration of a legacy datastore
US10997131B1 (en) Using a member attribute to perform a database operation on a computing device
EP4022427A1 (en) Generating software artifacts from a conceptual data model
CN114328574A (en) Data query method and device, electronic equipment and computer-readable storage medium
US10248668B2 (en) Mapping database structure to software
US20230074856A1 (en) Resolving data location for queries in a multi-system instance landscape
US8447773B2 (en) Accessing a database
CN103678396A (en) Data backup method and device based on data models
US11372859B2 (en) Efficiently supporting value style access of MOBs stored in SQL LOB column by providing value based semantics for LOBs in RDBMS
US11281569B2 (en) Self-curative computer process automates
US9843652B2 (en) Context switch of database connections
US8862544B2 (en) Grid based replication
CN102053823A (en) Method and device for connecting Java information platform and MySql database
CN103761233A (en) Method, device and system for processing database operation request
US20110302484A1 (en) Electronic Forms Completion Method
US20170220656A1 (en) Information Access System
US10025818B2 (en) Customize column sequence in projection list of select queries

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20110511