简体   繁体   English

我们可以在没有安装客户端和服务器的情况下从代码连接到SQL Server 2005数据库吗?

[英]Can we connect to SQL Server 2005 database from code with out having the installation of client and server

I need to retrieve data from the database. 我需要从数据库中检索数据。 I have the database name, username, password, servername, but I don't have the software installed in my machine. 我有数据库名称,用户名,密码,服务器名,但是我的计算机上没有安装该软件。 Can I connect to the db and retrieve the data from the db from database from Java code? 我可以连接到数据库并从Java代码从数据库中检索数据库中的数据吗?

您需要在运行应用程序以从其他计算机访问数据库的系统上至少拥有数据库驱动程序,例如ODBC或JDBC驱动程序。

从Java开始,只要安装了某种驱动程序(例如ODBC)就很容易。尝试使用odbc来 Googling 连接到db

Yes. 是。 The jdbc driver .jar can be used stand alone. jdbc驱动程序.jar可以单独使用。 It logs a warning about a missing .dll, but that can be ignored unless you need to use windows auth. 它会记录有关丢失的.dll的警告,但是除非您需要使用Windows身份验证,否则可以忽略该警告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM