Home Database Mysql Tutorial SQL Server 2008 连接JDBC图文

SQL Server 2008 连接JDBC图文

Jun 07, 2016 pm 04:19 PM
jdbc server Graphics and text connect

SQL Server 2008是目前windows上使用最多的sql数据库,2008的安装机制是基于framework重写的,特点是非常耗时间(我的小本本配置还是可以的。^_^)。但不需要原ISO或隐藏起来的MSI文件(如果你不小心手工删除这些安装文件的话,也不必担心。) 这也是为什么大多

   SQL Server 2008是目前windows上使用最多的sql数据库,2008的安装机制是基于framework重写的,特点是非常耗时间(我的小本本配置还是可以的。^_^)。但不需要原ISO或隐藏起来的MSI文件(如果你不小心手工删除这些安装文件的话,也不必担心。) 这也是为什么大多数时候,SQL Server 2008的安装日志文件setup.log会有1G大小的原因。因为安装工序实在是太庞大了。

  SQL Server 2008是一个重大的产品版本,它推出了许多新的特性和关键的改进,使得它成为至今为止的最强大和最全面的SQL Server版本。

  SQL Server 2008 的安装:

  下载SQL Server 2008的iso安装文件,用虚拟光驱打开,运行Setup

SQL Server 2008 连接JDBC图文 三联

  选择“安装” -> "全新sql独立安装"

SQL Server 2008 连接JDBC图文

  开始安装,中间需要填写数据库实例,选择混合密码登陆。

SQL Server 2008 连接JDBC图文

  实例随意命名

SQL Server 2008 连接JDBC图文

  账户名如图选择 NT AUTHORTIYSYSTEM

SQL Server 2008 连接JDBC图文

  身份验证模式设置为混合模式并设置密码。选择添加当前用户(系统管理员)。

SQL Server 2008 连接JDBC图文

  SQL Server 2008 配置

  安装完成后,SQL Server Management Studio就是数据库管理程序,SQL Server 配置管理器是配置程序。

SQL Server 2008 连接JDBC图文

  登陆SSMS(SQL Server Management Studio)的时候,服务器名称格式是 (local)安装时填写的实例名,身份验证用SQL 验证,登录名是系统默认的sa,密码是安装时选择混合模式自己设置的密码。

SQL Server 2008 连接JDBC图文

  如果不能登陆,选择Windows方式登陆,然后“安全性” -> "登录名" -> "sa" -> “状态” 设为启用,详细如图。

SQL Server 2008 连接JDBC图文

  打开SQL Server配置管理器

SQL Server 2008 连接JDBC图文

  选择SQL Server 网络配置里自己建立的实例的协议,选择TCP/IP协议设置为启用状态,将其中一个IP设置为本机 127.0.0.1,设为启用。再将IP ALL的端口设置为1433,动态端口设为空。如图。

SQL Server 2008 连接JDBC图文

SQL Server 2008 连接JDBC图文

  同样的,将客户端的端口也设置为1433,启用状态。

SQL Server 2008 连接JDBC图文

  然后!必须要重启SQL Server服务,不然即使电脑重启都是无效的。

SQL Server 2008 连接JDBC图文

  SQL Server 2008 连接JDBC

  OK,,启动你的SSMS,对数据库右键,“建立新的数据库”

SQL Server 2008 连接JDBC图文

  建立数据库后建立表,如图,建立表后要编辑表对表右键编辑前两百行。

SQL Server 2008 连接JDBC图文

SQL Server 2008 连接JDBC图文

  开始在eclipse里操作连接JDBC:

  首先要用到连接驱动,官方的驱动是sqlserver4.jar,不过这个包有时候用不起,这里用的是jtds驱动,JDK1.6用jtds 1.2.6。JDC1.7用1.3.0。 然后在ECLIPSE “项目” “属性” “构建路径” 里 “添加外部jar (add extern jar)”

  官网下载地址:

SQL Server 2008 连接JDBC图文

SQL Server 2008 连接JDBC图文

  然后就可以开始写测试代码了:

  [java] view plaincopy

  String JDriver = "net.sourceforge.jtds.jdbc.Driver"; //jtds驱动代码

  DB = "jdbc:jtds:sqlserver://127.0.0.1:1433;datebaseName=School"; //URL连接

  测试

  [java] view plaincopy

  String JDriver = "net.sourceforge.jtds.jdbc.Driver";

  String connectDB = "jdbc:jtds:sqlserver://127.0.0.1:1433;datebaseName=School";

  try {

  Class.forName(JDriver);

  } catch (Exception e) {

  System.out.println("加载数据库引擎失败");

  System.exit(0);

  }

  System.out.println("数据库加载成功");

  String user = "sa";

  String password = "xxxxxxxxxxxxxxxx";

  System.out.println("准备连接....");

  Connection connection = DriverManager.getConnection(connectDB,user,password);

  System.out.println("连接成功");

  Statement stmt = connection.createStatement();

  String sql0 = "USE 数据库名";

  stmt.execute(sql0);

  这里有一个小的需要注意的地方是,在eclipse里用到数据库的时候,最好在最前面加一句

  String sql0 = "USE 数据库名";

  stmt.execute(sql0);

  不然貌似对表的操作都会在系统数据库里进行而不是自己建立的数据库里。

  最后SQL Server 2008成功连接JDBC

SQL Server 2008 连接JDBC图文

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Complete Guide to Win11 Gamepad Connection Complete Guide to Win11 Gamepad Connection Jan 02, 2024 pm 05:26 PM

After updating to the latest win11 system, many users are not sure how to connect the controller to play games. For this reason, we have brought you a detailed tutorial on connecting the win11 controller today. If you haven't completed the connection yet, let's take a look at how to operate it. . How to connect the controller in win11: 1. Click Start below and then enter Windows Settings to open the "Control Panel". 2. After entering, you can find "View devices and printers" to enter. 3. At this point you can see the information about the controller device and just make the connection. 4. After the connection is successful, a √ appears, and the connection is completed.

win7 printer cannot connect error code 0x0000011b win7 printer cannot connect error code 0x0000011b Dec 26, 2023 pm 10:01 PM

Many times we need to use a computer to connect to the printer for various printing operations, but sometimes some users will encounter the problem that win7 cannot connect to the printer 0x0000011b. The following is the specific solution. win7 cannot connect to the printer 0x0000011b1. Shortcut key "win+r", enter "regedit" 2. Find the following path "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print" 3. Right-click to create a new value "DWORD (32-bit) value (D) and Set the value to 0. Name the new project "RpcAuthnLevelPri

How to check network connection details and status on Windows 11 How to check network connection details and status on Windows 11 Sep 11, 2023 pm 02:17 PM

In order to make sure your network connection is working properly or to fix the problem, sometimes you need to check the network connection details on Windows 11. By doing this, you can view a variety of information including your IP address, MAC address, link speed, driver version, and more, and in this guide, we'll show you how to do that. How to find network connection details on Windows 11? 1. Use the "Settings" app and press the + key to open Windows Settings. WindowsI Next, navigate to Network & Internet in the left pane and select your network type. In our case, this is Ethernet. If you are using a wireless network, select a Wi-Fi network instead. At the bottom of the screen you should see

How to connect keep body fat scale How to connect keep body fat scale Mar 07, 2024 pm 04:50 PM

How to connect the keep body fat scale? Keep has a specially designed body fat scale, but most users do not know how to connect the keep body fat scale. Next is the graphic tutorial on the connection method of the keep body fat scale that the editor brings to users. , interested users come and take a look! How to connect the keep body fat scale 1. First open the keep software, go to the main page, click [My] in the lower right corner, and select [Smart Hardware]; 2. Then on the My Smart Devices page, click the [Add Device] button in the middle; 3 , then select the device you want to add interface, select [Smart Body Fat/Weight Scale]; 4. Then on the device model selection page, click the [keep body fat scale] option; 5. Finally, in the interface shown below, finally [Add Now] at the bottom

How to solve limited network connection in Windows 10 How to solve limited network connection in Windows 10 Feb 19, 2024 pm 09:20 PM

Solutions to Restricted Network Connections in Win10 With the rapid development of technology, the Internet has become an indispensable part of people's lives. However, sometimes we may encounter some problems when connecting to the Internet on computers using the Windows 10 operating system, one of which is restricted connections. In this case, we cannot access web pages, download files, or use network functions normally. So, is there any way to solve this problem? This article will introduce you to several common solutions. 1. Check the network connection settings. First, I

What does printer error code 0x0000011b mean? What does printer error code 0x0000011b mean? Feb 18, 2024 pm 10:02 PM

What does 0x0000011b mean when connecting to a printer? Users often encounter various error codes when using computers, laptops or other devices. Among them, 0x0000011b is a common printer connection error code. So, what does connecting printer 0x0000011b mean? First, we need to understand the basic principles of printer connection. When we need to print files from the computer, we usually need to connect the printer to the computer for data transfer between the two. This connection can be made via

Shared printer cannot connect to printer Shared printer cannot connect to printer Feb 22, 2024 pm 01:09 PM

With the development of the digital era, shared printers have become an indispensable part of the modern office environment. However, sometimes we may encounter the problem that the shared printer cannot be connected to the printer, which will not only affect work efficiency, but also cause a series of troubles. This article aims to explore the reasons and solutions for why a shared printer cannot connect to the printer. There are many reasons why a shared printer cannot connect to the printer, the most common of which is network issues. If the network connection between the shared printer and the printer is unstable or interrupted, normal operation will not be possible.

How to install, uninstall, and reset Windows server backup How to install, uninstall, and reset Windows server backup Mar 06, 2024 am 10:37 AM

WindowsServerBackup is a function that comes with the WindowsServer operating system, designed to help users protect important data and system configurations, and provide complete backup and recovery solutions for small, medium and enterprise-level enterprises. Only users running Server2022 and higher can use this feature. In this article, we will explain how to install, uninstall or reset WindowsServerBackup. How to Reset Windows Server Backup If you are experiencing problems with your server backup, the backup is taking too long, or you are unable to access stored files, then you may consider resetting your Windows Server backup settings. To reset Windows

See all articles