Skip to content

Instantly share code, notes, and snippets.

@sathinduga
sathinduga / DBOperations.java
Created September 22, 2019 08:13
Sample JDBC Database Connection
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package testui;
//Import required packages
import java.sql.*;
@sathinduga
sathinduga / scheduler.py
Last active March 24, 2020 19:55
Heroku Python Script
import datetime
import pymongo
client = pymongo.MongoClient("mongodb://<user>:<password>@<host>:<port>/<db_namespace>")
def save_data_to_mongo(data):
db = client["<db_namespace>"]
collection = db["test_data"]
response = collection.insert_one(data)