Atitit. Structure and Storage Database Attilax Summary of various data types (tree structure, table shape data)

Source: Internet
Author: User
Tags ldap

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

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

2. Corresponding data structure in programming languages Java C # php (Dic/map List DataTable) 1

3. Database Storage data 1

4. Table-Shaped display of data (multiple records and single records) 2

5. ASP. NET Data Control: Gridview,datalist,repeater, Detailsview,formview. 2

6. Tree-shaped data common operations 2

6.1. Get all child nodes 2

7. Java Operations Registry 2

7.1. Using the Preferences API (Limited access Path) 2

7.2. Using JNI4

7.3. Jregistrykey Recommended 4

7.4. Jregistry 4

1. Data structure (tree-shaped structure, table shape data, object structure)

2.corresponding data structures in programming languages Java C # php (Dic/map List DataTable)

Author :: Old Wow's paw attilax ayron, email:[email protected]

Reprint please indicate source: Http://blog.csdn.net/attilax

3.Database Store Data

Table-shaped data is certainly suitable for common relational databases.

Tree database (Hierarchical database LDAP,, registry ), tree database can be accessed using LDAP, equivalent to Rmdb SQL

Object-oriented database db4o

4. Table-Shaped display of data (multiple records and a single record)

5. ASP. NET Data Control: Gridview,datalist,repeater, Detailsview,formview.


Overview of the ASP. NET Data Control:
1. The first 3 are used to render multiple records, and the next 2 are used to render a single data detail, that is, a common record detail.
The layout of the 2.GridView and DetailsView controls is fixed, and the layout features of the custom data display are limited, generally suitable for simple layout

Data rendering. 3.datalist,repeater and FormView data controls have strong custom layout capabilities, and if the data is rendered

A more complex layout scheme is required, and these 3 controls are preferred.

6. Tree-shaped data common operations 6.1. Get all child nodes

7. Java Operation Registry 7.1. UsePreferences API(Limited access Path)

Because the Java program is "write once, run everywhere", read and write the registry in Java, the program's cross-platform is poor. Java operation of the Registry, in the previous version of jdk1.4, that is not possible, can only be implemented with JNI, however, the Prefs package provided after jdk1.4 can operate the Windows registry, but the root of the death is only Software/javasoft/ Prefs, it is also due to this dilemma, but also to ensure that the so-called platform-independent, and to take care of everyone's reliance on Windows

. and  JDK  provide operation   WINDOWS    API  preferences API  WIN32  HKCU\SOFTWARE\JAVASOFT  HKLM\SOFTWARE\JAVASOFT 

Free access to the registry other key values are not available in Java , the inevitable solution is JNI,

The Preferences API is not designed to access the Windows Registry, which is a point to note.

The reason we have the above misunderstanding is becauseSunof theWindowsversion ofJDKin implementingPreferences APIwhen using theWindowsRegistry as a repository, that is, we use thePreferences APIthe stored data is saved to theWindowsregistry, soPreferenes APIand there's a visit.Windowsthe ability to register the table. But to other platforms or other vendors 'JDKWhat about the implementation? This question is andPreferences APIwe have no way to answer the relevant implementation.

If the program does not care about the details of the repository, just find a place to store the data, then the Preferences API is appropriate.

Preferences API is also limited, please consider two issues:

· OneJavasoftware, this time I'm inSunof theJDKrun and use thePreferences APISave my personal preferences, next time I'm inIBMof theJDKMy personal preferences can also bePreferences APIGet it? May or may not be, the behavior at this time is determined by theSunand theIBMof thePreferences APIimplementation of the decision. (In the sameJDKimplementations can use thePreferences APIto share data between different programs)

· A Java software needs to let the user set up with the operating system to start, similar requirements are many. Such a requirement is the ability of a Java program to have a real and relevant operating system to work together. This capability is not A design goal of the Preferences API.

There are two ways in which Java reads and writes to the registry:
1. Packages in the java.util.prefs.*
where Preferences.systemroot () gets the hkey_local_machine/software/javasoft/prefs can easily read and write the registry under this position
Preferences.userroot () Gets the hkey_local_user/software/javasoft/prefs that can be registered at this location

But for other
Location operation is not convenient.
Example code:
Import java.util.prefs.*;
public class Registery {
String[] keys = {"AAA", "BBB", "CCC"};
String[] values = {"1", "2", "3"};
Store the corresponding values in a variable.
public void WriteValue () {
Write the registry value under Hkey_local_machine/software/javasoft/prefs.
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 executing the code inserts three key values in the Hkey_local_machine/software/javasoft/prefs/javaplayer location

7.2. UseJNI

The Windows operating system provides APIsto operate the registry, so using JNI to Java and these APIs Together we get the ability to operate the registry with Java. This is a little easier to say, but it takes a lot of detail to get it to work. Fortunately this kind of work has already been done and we want to thank them. Let's take a look at one of the packages below.

Com.ice.jni.registrypackage is throughJNI (Java native Interface)implementation ofWindowsRegistry ActionsAPIthat can be used to access, modify, and exportWindowsRegistration Form. Now that the bag has been made public, you can use it with confidence without worrying about it.Licenseand includes a built-inDLLand theJava,Cthe source code. It can be used inJava 1.1and a higher version of the work.

2. Open source Read and write Registry library registry-3.1.3 home Address:http://www.trustice.com/java/jnireg/index.shtml
After download, you need to put Ice_jniregistry.dll in the bin directory of the JDK you are currently using.

7.3. Jregistrykey recommended 7.4. Jregistry

Jregistry accesses the Windows Registry API through JNI technology.

Atitit. Structure and Storage Database Attilax Summary of various data types (tree structure, table shape data)

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.