Atitit. Summary of the structure and storage database attilax of various data types (tree structure, table-shaped data), atititattilax

Source: Internet
Author: User

Atitit. Summary of the structure and storage database attilax of various data types (tree structure, table-shaped data), atititattilax

Atitit. Summary of the structure and storage database attilax of various data types (tree structure and table data)

 

1. Data Structure (tree structure, table data, object structure) 1

2. The corresponding data structure in the programming language java c # php (Dic/Map List datatable) 1

3. database storage data 1

4. Data Table display (multiple records and one record) 2

5. ASP. NET data controls: GridView, DataList, Repeater, DetailsView, and FormView. 2

6. Common Operations on tree data 2

6.1. Get all child nodes 2

7. Java operation registry 2

7.1. Use the Preferences API (the access path is limited) 2

7.2. Use JNI4

7.3. Jregistrykey Recommendation 4

7.4. Jregistry 4

 

1. Data Structure (tree structure, table data, object structure)

 

2. The corresponding data structure in the programming language java c # php (Dic/Map List datatable)

 

 

Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com

Reprinted please indicate Source: http://blog.csdn.net/attilax

 

3. database storage data

Table data is certainly suitable for common relational databases ..

Tree database (hierarchical database ldap, and Registry), the tree database can be accessed using LDAP, equivalent to rmdb SQL

Object-Oriented Database db4o

 

 

 

4. Data Table display (multiple records and one record)

 

 

 

 

5. ASP. NET data controls: GridView, DataList, Repeater, DetailsView, and FormView.

 
Summary of ASP. NET data controls:
1. The first three are used to present multiple records, and the last two are used to present single data details, that is, common record details.
2. The layout of the GridView and DetailsView controls is fixed, and the layout function of custom data display is limited, which is generally suitable for simple layout.

Data presentation. 3. DataList, Repeater, and FormView data controls have strong custom Layout capabilities.

Complex layout solutions are required. These three controls are the first choice.

 

 

6. Common tree data operations 6.1. Get all child nodes

 

 

7. Java operation registry 7.1. Use the Preferences API (restrict the access path)

Since the java program is "write once, run everywhere", using java to read and write the registry, the cross-platform nature of the program will be poor. Java operations on the registry are not possible in versions earlier than jdk1.4 and can only be implemented using JNI. However, the prefs package provided after jdk1.4 can be used to operate the windows registry, however, it is fixed that root is only in the SOFTWARE/kerberoft/prefs environment. It is probably out of this dilemma. It is also necessary to ensure that the so-called platform is irrelevant and take care of your reliance on windows.

. JDK provides Windows-enabled APIs, that is, Preferences. This API is also cross-platform and has weak functions, in Win32, data can only be used to operate data of HKCU \ Software \ JavaSoft and HKLM \ Software \ JavaSoft and its subnodes.

You cannot freely access the values of other keys in the registry using Java, and the necessary solution is JNI,

 

Preferences API is not designed to access the Windows registry, which is worth noting.

The above misunderstanding is that Sun's Windows JDK uses the Windows registry as the repository when implementing the Preferences API, that is, the data stored using the Preferences API is saved to the Windows registry, so that the Preferenes API can access the Windows registry. But what if I switched to another platform or another vendor's JDK implementation? This question is related to the implementation of the Preferences API and cannot be answered.

If the program does not care about the details of the repository, but wants to find a place to store data, the Preferences API is suitable.

The Preferences API is also limited. Please consider two issues:

· A Java software. This time I run it on Sun's JDK and use the Preferences API to save my personal Preferences. Next time I run it on IBM's JDK, can my Preferences be obtained through the Preferences API? It may or may not. At this time, the behavior is determined by the implementation of the Preferences API of Sun and IBM. (In the same JDK implementation, you can use the Preferences API to share data among different programs)

· A Java software requires users to set whether to start with the operating system. There are still many similar requirements. This requirement requires that Java programs have the ability to truly coordinate with relevant operating systems. This capability is not designed for Preferences APIs.

Java requires two methods to read and write the registry:
1. packages in java. util. prefs. *
Preferences. systemRoot () obtains HKEY_LOCAL_MACHINE/Software/kerberoft/prefs, which allows you to conveniently read and write the registry.
Preferences. userRoot () obtains HKEY_LOCAL_USER/Software/kerberoft/prefs, which can be used for registry

However
Location operations are inconvenient.
Sample Code:
Import java. util. prefs .*;
Public class Registery {
String [] keys = {"aaa", "bbb", "ccc "};
String [] values = {"1", "2", "3 "};
// Store the corresponding value in the Variable
Public void writeValue (){
// HKEY_LOCAL_MACHINE/Software/export oft/prefs write the registry value.
Preferences pre = Preferences. systemRoot (). node ("/javaplayer ");
For (int I = 0; I <keys. length; I ++ ){
Pre. put (keys, values );
}
}
Public static void main (String [] args ){
Registery reg = new Registery ();
Reg. writeValue ();
}
}
The result of code execution inserts three key values at HKEY_LOCAL_MACHINE/Software/JavaSoft/prefs/javaplayer.

7.2. Use JNI

The Windows operating system provides APIs for operating the registry. Therefore, using JNI to connect Java with these Apis gives us the ability to operate the registry using Java. This is a bit simple, but a lot of details need to be processed. Fortunately, someone has done this kind of work, and we want to thank them. Next let's take a look at one of the packages.

The com. ice. jni. registry package is a Windows registry operation API implemented by JNI (Java native interface). It can be used to access, modify, and export Windows registries. Now that this package is open, you can use it with confidence without worrying about the license issue. It also includes the source code of a constructed DLL, Java, and C. It can work in Java 1.1 and later versions.

 

2. repository registry-3.1.3 Home Address: http://www.trustice.com/java/jnireg/index.shtml
After downloading ICE_JNIRegistry.dll, put it in the bin directory of the currently used jdk.

7.3. Jregistrykey Recommendation 7.4. Jregistry

JRegistry uses JNI technology to access WINDOWS Registry APIs.

 

 

Related Article

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.