在SQL Server中使用doctrine 2 [英] using doctrine 2 with SQL Server

查看:130
本文介绍了在SQL Server中使用doctrine 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经完成了对SQL Server的完全控制,因此我需要将现有的基于doctrine 2的beta版本的项目从mysql迁移到SQL Server。



在Doctrine的DBAL文件夹中已经有一个PDOMsSql驱动程序,但是我无法弄清楚如何使用它。 (仍然没有文件)



Doctrine还提供了另外两种方式,我可以使用:




  • driverClass:如果未指定driver,则指定自定义驱动程序实现。这允许使用不属于Doctrine DBAL本身的自定义驱动程序。

  • pdo:指定要使用的现有PDO实例。



有人可以帮我吗?我不知道如何从这里开始,因为我根本没有ODBC / PDO和SQL Server的经验。

解决方案

我自己想出来...在mac上,mssql.so只提供dblib:作为司机。所以通过用dblib来替代Doctrine驱动中的dbo_mssql,定义一个FreeTDS主机,并使用它的名字作为我的连接的主机名,一切正常。


I need to migrate an existing project, built on the current beta of doctrine 2, from mysql to SQL Server.

I have complete control of the SQL Server.

In the DBAL Folder of Doctrine there already is a PDOMsSql driver, but I can't figure out, how to use it. (there is still no documentation)

Doctrine also offers two other ways, I could maybe use:

  • driverClass: Specifies a custom driver implementation if no 'driver' is specified. This allows the use of custom drivers that are not part of the Doctrine DBAL itself.
  • pdo: Specifies an existing PDO instance to use.

Could anyone help me with this? I have no clue how to start here, since I have no experience with ODBC/PDO and SQL Server at all.

解决方案

I figured it out by myself... on a mac, "mssql.so" does only provide "dblib:" as a driver. So by replacing dbo_mssql in the Doctrine Driver with "dblib", defining a FreeTDS host and using its name as the hostname for my connection, everything works fine.

这篇关于在SQL Server中使用doctrine 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆