Advertisement
Guest User

Untitled

a guest
Nov 30th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. private string function $getDBType() {
  2. local.info = $dbinfo(
  3. type="version",
  4. datasource=application.wheels.dataSourceName,
  5. username=application.wheels.dataSourceUserName,
  6. password=application.wheels.dataSourcePassword
  7. );
  8. if (local.info.driver_name Contains "SQLServer" || local.info.driver_name Contains "Microsoft SQL Server" || local.info.driver_name Contains "MS SQL Server" || local.info.database_productname Contains "Microsoft SQL Server") {
  9. local.adapterName = "MicrosoftSQLServer";
  10. } else if (local.info.driver_name Contains "MySQL") {
  11. local.adapterName = "MySQL";
  12. } else if (local.info.driver_name Contains "Oracle") {
  13. local.adapterName = "Oracle";
  14. } else if (local.info.driver_name Contains "PostgreSQL") {
  15. local.adapterName = "PostgreSQL";
  16. } else if (local.info.driver_name Contains "SQLite") {
  17. local.adapterName = "SQLite";
  18. // NB: using mySQL adapter for H2 as the cli defaults to this for development
  19. } else if (local.info.driver_name Contains "H2") {
  20. local.adapterName = "H2";
  21. } else {
  22. local.adapterName = "";
  23. }
  24. return local.adapterName;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement