Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use ActiveJDBC

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report