第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將設(shè)置數(shù)組存儲到數(shù)據(jù)庫行中

將設(shè)置數(shù)組存儲到數(shù)據(jù)庫行中

蕪湖不蕪 2021-06-15 16:30:26
我想優(yōu)化到數(shù)據(jù)庫行應(yīng)用程序設(shè)置。像這樣的東西10 - enabled option 1;12 - enabled option 2;13 - enabled option 3;并將整個數(shù)字作為 1073741823 存儲到數(shù)據(jù)庫中。我試圖實現(xiàn)這一點:公共無效測試(){    // Let's say you get a String representing your option from your database    String optionFromDB= "132456";    // optionFromDB is a number like "132456"    // We transform it to bigDecimal:    BigDecimal myOptions=new BigDecimal(optionFromDB);    // Then we can use it.    // enable the option X (X is a number)    myOptions.setBit(2);    // Disable option X    myOptions.clearBit(2);    // Save the options to the db:    String newValToSave=myOptions.toString();    // do something if option x enable:    if (myOptions.testBit(123)){         System.out.println("test");    }       }我該如何正確實施?
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 180 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號