Guest User

Untitled

a guest
Apr 8th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. # -*- coding: cp1252 -*-
  2.  
  3. class Conexao(object):
  4.  
  5. __hostname = None
  6. __username = None
  7. __password = None
  8. __dbname = None
  9. __cursor = None
  10. __conexao = None
  11.  
  12. def __init__(self):
  13. self.conectar()
  14.  
  15. def __del__(self):
  16. self.desconectar()
  17.  
  18. def setHostname(self, hostname):
  19. self.__hostname = hostname
  20.  
  21. def setUsername(self, username):
  22. self.__username = username
  23.  
  24. def setPassword(self, password):
  25. self.__password = password
  26.  
  27. def setDbname(self, dbname):
  28. self.__dbname = dbname
  29.  
  30. def setCursor(self, cursor):
  31. self.__cursor = cursor
  32.  
  33. def setConexao(self, conexao):
  34. self.conexao = conexao
  35.  
  36. def setAutoCommit(self, autocommit):
  37. self.conexao.autocommit = autocommit
  38.  
  39. def getHostname(self):
  40. return self.__hostname
  41.  
  42. def getUsername(self):
  43. return self.__username
  44.  
  45. def getPassword(self):
  46. return self.__password
  47.  
  48. def getDbname(self):
  49. return self.__dbname
  50.  
  51. def getCursor(self):
  52. return self.__cursor
  53.  
  54. def getConexao(self):
  55. return self.conexao
  56.  
  57. def getAutoCommit(self):
  58. return self.conexao.autocommit
Add Comment
Please, Sign In to add comment