How to use ActiveJDBC
This article mainly explains "how to use ActiveJDBC". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to use ActiveJDBC.
ActiveJDBC is a fast and lightweight Java ORM framework with simple syntax and easy to understand, while supporting multiple database links. The documentation for ActiveJDBC is very complete. Design based on the following principles:
Convention is more important than configuration (no configuration)
Knowledge of SQL is sufficient.
Lightweight and intuitive code
No conversation
No persistence layer management
No proxying
Here is a simple Model class:
Public class Main {public static void main (String [] args) {new DB ("corporation") .open ("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/test", "root", "p@ssw0rd") New DB ("university"). Open ("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@localhost:1521:xe", "activejdbc", "activejdbc"); Employee.deleteAll (); Student.deleteAll (); Employee.createIt ("first_name", "John", "last_name", "Doe") Employee.createIt ("first_name", "Jane", "last_name", "Smith"); Student.createIt ("first_name", "Mike", "last_name", "Myers"); Student.createIt ("first_name", "Steven", "last_name", "Spielberg"); System.out.println ("* Employees") Employee.findAll (). Dump (); System.out.println ("* Students * *"); Student.findAll (). Dump (); new DB ("corporation"). Close (); new DB ("university"). Close ();} so far, I believe you have a deeper understanding of "how to use ActiveJDBC", you might as well do it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!