Posts

Showing posts from April 6, 2019

create a global jdbc connection in scala to run multiple queries

Image
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box; } 0 I am trying to create a code that basically creates a jdbc connection (only once) to the run a certain function n times. How would this be possible? I have tried something like this: class conn(name: String) { DriverManager.registerDriver(new OracleDriver()) val conn = DriverManager.getConnection("jdbc:oracle:thin:@rest_of_the_link", "user", "pass") var output : Int; def spArray() : Int = { var callableStatement: CallableStatement = conn.prepareCall("Statement_to_run;") callableStatement.registerOutParameter(1,Types.INTEGER) callableStatement.execut

Linux swap file creation and management

Image
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0; } 4 I want to increase my swap size to be able to have the hibernate option. First, I tried to add some swapfile. I followed https://bogdancornianu.com/change-swap-size-in-ubuntu/ and typed this in my terminal: sudo dd if=/dev/zero of=swapfile bs=1G count=16 I get: 16+0 records in 16+0 records out 17179869184 bytes (17 GB, 16 GiB) copied, 206.949 s, 83.0 MB/s then, I followed the instructions: sudo mkswap /swapfile But I get this error: mkswap: cannot open /swapfile: No such file or directory Then, I decided to resize my swap partition instead of swapfile. So I want to delete them. (I didn't create any before so I assume I can delete