首页 \ 问答 \ 有没有韩顺平的linux高清视频教程?有的发一下,谢谢,

有没有韩顺平的linux高清视频教程?有的发一下,谢谢,

更新时间:2021-09-19 14:09

最满意答案

一、JAVA连接SQL的语句 

JAVA连接SQL2000语句为: 
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
DriverManager.getConnection("jdbc:odbc:数据库名","数据库登录名","登录密码"); 

但连接SQL2005,已经改为: 
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); 
DriverManager.getConnection("jdbc:sqlserver://localhost:1433; DatabaseName=数据库名","数据库登录名","登录密码"); 

二、JAVA连接SQL都要用到驱动程序 

SQL2000需要三个jar包:mssqlservice.jar,msutil.jar,msbase.jar 
SQL2005需要一个jar包:sqljdbc.jar 
所以SQL2000和2005的连接方法是不一样的, 
到微软下载"Microsoft SQL Server 2005 JDBC Driver"最新版本,现在的应该是1.2 

下面Microsoft SQL Server 2005 JDBC Driver的安装说明: 
1. 将 sqljdbc_<版本>_enu.exe 下载 
2. 运行 sqljdbc_<版本>_enu.exe 
3. 出现提示时,输入安装目录;建议您将此 zip 文件解压缩到 %ProgramFiles% 中的默认目录下: 
Microsoft SQL Server 2005 JDBC Driver 
4.在环境变量CLASHPATH后加上C:\Program Files\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.2\enu\sqljdbc.jar(这是1.2版的,其它版本按实际修改......) 

但上面只解决了驱动程序的问题..... 

三、另外有时候会出现"SQL SERVER 2005使用sa 登录失败-提示该用户与可信 SQL Server 连接无关联"或除sa外的用户登录失败的问题. 

解决方法如下: 

1.打开SQL Server Management Studio 
2.右键点击服务器,选择Properties(属性),点击Security(安全性), 
将server authentication服务器身份认证从windows authentication mode(windows身份认证模式) 
修改为Sql Server and Windows Authentication mode(SQL server和windows身份认证模式). 
3.回到SQL Server Management Studio服务器那,在服务器下双击打开security(安全性) -- logins(登录名) ,右键选中sa,选择properties(属性),点击Status(状态),在设置中将Login(登录)设置为Enabled(启用)。(忘记sa密码的可在常规修改密码) 

四、设置SQL Server服务器 
1、打开SQL Server Configuration Manager”,双击“SQL Server 2005网络配置”,点击“MSSQLSERVER 的协议” 
2、如果“TCP/IP”没有启用,右键单击选择“启动”。 
3、双击“TCP/IP”进入属性设置,在“IP 地址”里,可以配置“IPAll”中的“TCP 端口”,默认为1433,将IP地址中的“已启用”设为“是”。 
4、重新启动SQL Server 
5、运行正常。

package pkg;

import java.sql.*;

public class Test {
 public static void main(String args[]) {
 String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; // 加载JDBC驱动
 String dbURL = "jdbc:sqlserver://localhost:1433;integratedSecurity=true;DatabaseName=wulei"; // 连接服务器和数据库sample
 Connection dbConn;
 try {
 Class.forName(driverName);
 dbConn = DriverManager.getConnection(dbURL);
 System.out.println("Connection Successful!"); // 如果连接成功
 // 控制台输出Connection
 // Successful!
 } catch (Exception e) {
 e.printStackTrace();
 }
 }
}

相关问答

更多
  • public static void main(String[] args) { String driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"; String url="jdbc:sqlserver://127.0.0.1;databaseName=master"; try { Class.forName(driverClassName); java.sql.Connection con = java.sql.DriverMana ...
  • 一、JAVA连接SQL的语句 JAVA连接SQL2000语句为: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); DriverManager.getConnection("jdbc:odbc:数据库名","数据库登录名","登录密码"); 但连接SQL2005,已经改为: Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); DriverManager.getConnection("jdbc ...
  • 一、JAVA连接SQL的语句 JAVA连接SQL2000语句为: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); DriverManager.getConnection("jdbc:odbc:数据库名","数据库登录名","登录密码"); 但连接SQL2005,已经改为: Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); DriverManager.getConnection("jdbc ...
  • "jdbc:sqlserver://localhost:1433;integratedSecurity=true;(该句话是用windows身份验证)DatabaseName=db_shop(这是数据库名)" 注意要用localhost
  • 在Visual Studio中,您可以执行大部分您想要执行的数据库开发任务,而无需使用Management Studio。 下面是一篇描述如何在服务器资源管理器中连接到数据库的文章: 如何在Visual Studio .NET和Visual Studio 2005中使用服务器资源管理器 如果您在Visual Studio中看不到服务器资源管理器,请执行以下操作 。 下面是一个视频,帮助您开始 : 如何在MS Visual Studio 2005中使用服务器资源管理器 In Visual Studio, yo ...
  • 您获得的可视化工作室是一个名为Business Intelligence Development studio的shell,它允许您创建Analysis Services,Integration Services和Reporting Services项目。 它还允许您将这些项目部署到SQL Server。 如果已安装Visual Studio,则会将这些项目类型添加到其中。 使用Development Studio,您可以将C.Net项目(如C#或VB)添加到Analysis Services或Report ...
  • SQL Server Express版本不包含SSIS包。 请检查此http://www.microsoft.com/Sqlserver/2005/en/us/compare-features.aspx 解决这个问题的一种方法是在Standard Edition上构建SSIS包并复制它们。 在这里,这可能是方便的http://daron.yondem.com/PermaLink.aspx?guid=c44d040b-ed02-4330-a662-4cd9d6fb1bf3 干杯 SQL Server Expr ...
  • 有一点需要注意:连接上出现足够严重(20+)的错误会导致整个连接 - 游标,本地临时表和所有连接。 One thing comes to mind: a sufficiently severe (20+) error being raised on the connection will blow away the entire connection -- cursors, local temporary tables and all.
  • SQL Server的这个实例是在你连接的同一台PC上运行的? 这就是'本地'的含义。 可能性: 1)尝试(本地)而不是本地服务器名称 2)尝试'MSSQLSERVER'作为名称 3)检查SQL Server配置管理器显示您尝试连接的相同配置选项,例如相同的实例名称,启用命名管道,服务正常运行等。 编辑: 好的,你用什么来连接? SQL Server Management Studio Express? 你确定你安装了一个实例吗? 服务列表中缺少SQLExpress似乎表明了其他情况。 This insta ...
  • 运行表面区域配置工具: 开始>所有程序> Microsoft SQL Server 2005> Contifuration Tools> Sql Server表面区域配置 单击“ 服务和连接的区域配置”链接。 在下一个窗口中,单击要配置的服务器下的“ 远程连接”项。 现在在右侧选择“本地和远程连接” ,然后选择“同时使用TCP / IP和命名管道” 。 希望这能解决你的问题。 编辑:你可以在微软查看这些文章。 So after doing some more research, it turns out t ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)