1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        ActiveJDBC小型ORM框架

        聯(lián)合創(chuàng)作 · 2023-09-30 03:15

        ActiveJDBC 是一個(gè)快速和輕量級的 Java 的 ORM 小型框架,語法簡單易于理解,同時(shí)支持多數(shù)據(jù)庫鏈接。ActiveJDBC 的文檔(javadoc)非常完善?;谝韵略瓌t設(shè)計(jì):

        • 慣例重于配置(無配置)
        • 擁有 SQL 知識就足夠了
        • 輕量級而且直觀的代碼
        • 無會話
        • 無持久層管理
        • 無 proxying

        下面是一個(gè)簡單的 Model 類:

        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();
            }
        }
        瀏覽 27
        點(diǎn)贊
        評論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評論
        圖片
        表情
        推薦
        點(diǎn)贊
        評論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            小早川怜子东京热无码 | 国产精品99久久久久久久久 | 俺来也我也去www官网 | 国内自拍视频网站 | 网友自拍超碰 | 中文字幕久久久久 | 天天操夜夜拍拍免费观看 | 久久调教视频 | 淫秽视频免费看 | 97超碰在线人人 |