2018년 8월 19일 일요일

USA PowerBall android App



USA PowerBall android App

Power ball

Simple lottery number generator
Simple Share your number for friends and family
This App is very simple and great

2018년 4월 6일 금요일

코틀린 mongo db 접속 확인

코틀린 mongo db 접속 확인

코틀린 몽고 디비 접속 확인 소스



import com.mongodb.MongoClient
import com.mongodb.ServerAddress

object mongo {
    @JvmStatic
    fun main(args: Array) {


        val MongoDB_IP = "10.10.10.1"
        val MongoDB_PORT = 27017
        val DB_NAME = "admin"

        //Connect to MongoDB
        val mongoClient = MongoClient(ServerAddress(MongoDB_IP, MongoDB_PORT))

        //View Database List
        val databases = mongoClient.databaseNames

        println("=====Database List===== ")
        var num = 1
        for (dbName in databases) {
            println(num.toString() + ". " + dbName)
            num++
        }

        println()

        //Connect Database and Show Collection List in Database
        val db = mongoClient.getDB(DB_NAME)
        val collections = db.collectionNames

        println("Database : $DB_NAME")
        for (colName in collections) {
            println(" + Collection: $colName")
        }
    }
}





결과 
=====Database List===== 
1. admin
2. config
3. local

Database : admin
 + Collection: system.users
 + Collection: system.version

Process finished with exit code 0