[英]connecting to SQL Server from Netbeans
I am trying to connect to a server instance of SQL Server 2010 that I installed recently using NetBeans. 我试图连接到最近使用NetBeans安装的SQL Server 2010服务器实例。 I have downloaded the latest JDBC driver for MS SQL Server, but I cannot get the right connection string to connect to this database.
我已经下载了用于MS SQL Server的最新JDBC驱动程序,但是无法获得正确的连接字符串来连接到该数据库。 I think I am missing the following values in the connection:
我认为我在连接中缺少以下值:
'jdbc:sqlserver://' 'JDBC:SQLSERVER://'
Any help appreciated, 任何帮助,赞赏,
Ted 摊晒
Port number should normally be 1433 for MSSQL, but often, this may not even be specified, so to do that you would need to: 对于MSSQL, 端口号通常应为1433,但通常甚至可能没有指定端口号,因此您需要:
The instance name is not necessary, it can be left blank. 实例名称不是必需的,可以保留为空白。
Now for Username : 现在输入用户名 :
Note that what comes after // (jdbc:sqlserver://) is usually the host and not your username.
请注意,//(jdbc:sqlserver://)之后通常是主机,而不是您的用户名。
Go back into NetBeans and try to connect again. 返回NetBeans,然后尝试再次连接。 This time using Port 1433, nothing for Instance Name, username as 'sa' and password .
这次使用端口1433,实例名称,用户名'sa'和密码都没有。 Test the connection to ensure you get no errors.
测试连接以确保没有错误。 Good luck.
祝好运。
This should help: 这应该有助于:
http://netbeans.org/kb/docs/java/gui-db.html http://netbeans.org/kb/docs/java/gui-db.html
Edit : As per comment below this was for derby stuff. 编辑 :根据下面的评论这是德比的东西。 Here is a more useful link but it's not got any information on supplying the DB username or password.
这是一个更有用的链接,但没有提供数据库用户名或密码的任何信息。 It might be enough depending on your exact requirement.
根据您的确切要求,可能就足够了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.