db_oracle.go 579 B

12345678910111213141516171819202122232425262728293031
  1. package main
  2. import (
  3. "fmt"
  4. "gitee.com/wlhet/sqlm"
  5. )
  6. var oracleDb *sqlm.Oracle
  7. func regOrcle(brand string) {
  8. url := ""
  9. switch brand {
  10. case "ugg":
  11. url = fmt.Sprintf("oracle://bosnds3:Longda2000@%s.imix7.com:1521/orcl", brand)
  12. case "hdugg":
  13. url = fmt.Sprintf("oracle://bosnds3:Longda2000@%s.imix7.com:1521/orcl", brand)
  14. case "ecco":
  15. url = fmt.Sprintf("oracle://bosnds3:Longda2000@%s.imix7.com:1521/orcl", brand)
  16. }
  17. if len(url) == 0 {
  18. panic("oracle brand error")
  19. }
  20. db := sqlm.NewOracle()
  21. err := db.Open(url)
  22. if err != nil {
  23. panic(err)
  24. }
  25. oracleDb = db
  26. }