예제 #1
0
 def __init__(self):
     self.server = socket.socket()
     # self.conn = db.dbConnection("localhost", "sa", "8575", "market")
     self.conn = db.dbConnection(
         'database-1.csnqzpism18o.us-east-1.rds.amazonaws.com:1433',
         'admin', '***', 'market')
     self.receive()
예제 #2
0
 def __init__(self):
     LogHandler.log_msg("Initializing tools..")
     self.__con = dbConnectionEngine()
     LogHandler.log_msg("Fetch current table attribute")
     self.__con.loadModelProperties(self.mp)
     LogHandler.log_msg("Done.")
     self.__mysqlCon = dbConnection()
예제 #3
0
 def dbConfigure(self,
                 host="localhost",
                 port=3306,
                 user='******',
                 passwd='cloud',
                 db='cloud'):
     self.dbConnection = dbConnection.dbConnection(host, port, user, passwd,
                                                   db)
예제 #4
0
 def build(self):
     connectionManager=dbConnection("dbAppliBodyJeet")
     conn=connectionManager.createConnection()
     cursor=connectionManager.createCursor(conn)
     cursor.execute("SELECT * FROM CATEGORIE_EXERCICE")
     exercice=""
     for line in cursor:
         exercice=exercice+line[1]+"\n"
     return Label(text=exercice)
예제 #5
0
 def Login_Event(self):
     dbconnection = dbConnection()
     self.username_input = self.user_entry.get()
     self.password_input = self.pass_entry.get()
     profile, user, friends, pictures = dbconnection.retrieve(
         self.username_input, self.password_input)
     self.root.destroy()
     ##make an object of your class here. Don't waste time in making this:)
     root = Tk()
     home_page = Home_Page(root, user, dbconnection, friends, pictures,
                           profile)
     root.mainloop()
예제 #6
0
def main():
    #try:
    while True:
        d = dbConnection.dbConnection()
        print("R: get recipe names from ingredient")
        print("I: get ingredient names from recipe")
        print("Q: quit program")
        c = input("Enter command: ")
        if(c == "R" or c == "r"):
            i = input("Enter ingredient name: ")
            d.getRecipeFromIng(i)
        if(c == "I" or c == "i"):
            r = input("Enter recipe name: ")
            d.getIngFromRecipe(r)
        if(c == "Q" or c == "q"):
            break
예제 #7
0
    def Signup_Event(self):
        dbconnection = dbConnection()
        self.name_input = self.name_entry.get()
        self.username_input = self.user_entry.get()
        self.password_input = self.pass_entry.get()
        self.country_input = self.country_entry.get()
        self.mobile_input = self.mobile_entry.get()

        dbconnection.insert(self.name_input, self.username_input,
                            self.password_input, self.country_input,
                            self.mobile_input)
        profile_image, user, friends, pictures = dbconnection.retrieve(
            self.username_input, self.password_input)

        self.root.destroy()
        root = Tk()
        profile = Profile(root, dbconnection, user, friends, pictures,
                          profile_image)
        root.mainloop()
 def dbConfigure(self, host="localhost", port=3306, user='******', passwd='cloud', db='cloud'):
     self.dbConnection = dbConnection.dbConnection(host, port, user, passwd, db)
예제 #9
0
 def dbConfigure(self, host="localhost", port=3306, user='******', passwd='cloud', db='cloud'):
     self.dbConnection = dbConnection.dbConnection(host, port, user, passwd, db)
     self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, self.dbConnection)
예제 #10
0
# Pip - Imports
from falcon import falcon
import json

# Project - Imports
from dbConnection import dbConnection

# DB-Obj
internal_dbConnection = dbConnection()  # Init. DB Connection

#
# One Class - One Endpoint
#


class Example(object):
    def on_get(self, req, resp):
        resp.body = json.dumps("This is a test")


class DataBase(object):
    def on_post(self, req, resp):
        if req.content_length:  # length > 0
            req_stream = req.bounded_stream.read()
            req_dict = json.loads(req_stream.decode('utf-8'))

        if req_dict["sql"] != None:  # If request is formated correctly
            return_value = internal_dbConnection.run_sql(
                req_dict["sql"])  # Run SQL Command
            if return_value == "Error":
                resp.body = '{ "message" : "SQL Error" }'