社区
Eclipse
帖子详情
Myeclipse 与sqlserver连接出错
douchog_13k
2008-10-07 10:04:49
我的是xp系统,我们在学j2ee要用到Myeclipse连接数据库sqlserver2000可是出现
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC] Error establishing socket
的错误,sp3补丁已经装上,telnet 127.0.0.1 1433时连接出错。
哪位高人能帮一下忙啊。可加我QQ:365832692
...全文
186
15
打赏
收藏
Myeclipse 与sqlserver连接出错
我的是xp系统,我们在学j2ee要用到Myeclipse连接数据库sqlserver2000可是出现 java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC] Error establishing socket 的错误,sp3补丁已经装上,telnet 127.0.0.1 1433时连接出错。 哪位高人能帮一下忙啊。可加我QQ:365832692
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
15 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
lihan6415151528
2008-10-13
打赏
举报
回复
sp4 补丁
East271536394
2008-10-10
打赏
举报
回复
打一个SP4的补丁
用下面的代码就OK
package com.shop.db;
import java.sql.*;
import java.io.*;
/**************************************************
* author:East(张栋芳)
* date:2008-6-13
* note:打开数据库的连接,和关闭连接
**************************************************/
public final class DataBaseOperator {
public DataBaseOperator() {
}
/***
*连接数据库用户指定driver,url,user,pwd
*/
public static Connection createConnection(String driver,String url,String user,String pwd){
Connection con = null;
try{
Class.forName(driver);
con = DriverManager.getConnection(url,user,pwd);
}catch(ClassNotFoundException ce){
ce.printStackTrace();
}catch(SQLException se){
se.printStackTrace();
}
return con;
}
/***
*连接数据库用户用默认的SQL server 2000的纯驱动
*/
public static Connection createConnection(){
String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url = "jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=pubs";
String user = "sa";
String pwd = "";
return createConnection(driver,url,user,pwd);
}
/***
*创建一个连接通过配制文件
*/
public static Connection createConnection(String fileName){
String driver="";
String url="";
String user="";
String pwd="";
BufferedReader in = null;
try{
in = new BufferedReader(new FileReader(fileName));
driver = in.readLine();
url = in.readLine();
user = in.readLine();
pwd = in.readLine();
in.close();
}catch(IOException ioe){
ioe.printStackTrace();
}
return createConnection(driver,url,user,pwd);
}
/***
*创建一个连接桥驱动
*/
public static Connection createConnection(String driver,String url){
driver = "sun.jdbc.odbc.JdbcOdbcDriver";
url = "jdbc:odbc:myodbc";
String user = "sa";
String pwd = "";
return createConnection(driver,url,user,pwd);
}
/***
*关闭连接。con,pstmt,rs;
*/
public static void closeAll(Connection con,PreparedStatement pstmt,ResultSet rs){
try{
if(rs != null)rs.close();
if(pstmt != null) pstmt.close();
if(con != null) con.close();
}catch(SQLException se){
se.printStackTrace();
}finally{
rs = null;
pstmt = null;
con = null;
}
}
/***
*关闭连接。con,pstmt;
*/
public static void closeAll(Connection con,PreparedStatement pstmt){
try{
if(pstmt != null) pstmt.close();
if(con != null) con.close();
}catch(SQLException se){
se.printStackTrace();
}finally{
pstmt = null;
con = null;
}
}
/***
*关闭连接。con
*/
public static void closeAll(Connection con){
try{
if(con != null) con.close();
}catch(SQLException se){
se.printStackTrace();
}finally{
con = null;
}
}
/**
*关闭一个连接con,stmt,rs
*/
public static void closeAll(Connection con,Statement stmt,ResultSet rs){
try{
if(con != null) con.close();
if(stmt != null) stmt.close();
if(rs != null) rs.close();
}catch(SQLException se){
se.printStackTrace();
}
}
/**
*关闭一个连接con,stmt
*/
public static void closeAll(Connection con,Statement stmt){
try{
if(con != null) con.close();
if(stmt != null) stmt.close();
}catch(SQLException se){
se.printStackTrace();
}
}
}
dujun3245350
2008-10-09
打赏
举报
回复
接分
java__king
2008-10-09
打赏
举报
回复
sp3不够啊,要用SP4的
Rainyword
2008-10-08
打赏
举报
回复
数据库JDBC驱动有没装?
sebatinsky11111
2008-10-08
打赏
举报
回复
呵呵,首先:下个补丁,sp4的,装上,问题解决,
或者是可以在myeclipse中测试你的数据库是否可以连上,用myeclipse中的数据库连接,自己测试一下,
或者按照七楼的说得,看看一些端口设置,或者是其他的什么问题。解决,我的没有问题,没有升级,也没有测试,直接连接,还有就是设置断点,看看你的语法上有问题没?
月夜雪
2008-10-08
打赏
举报
回复
可能是端口号问题。你按照一下步骤来,试下
1. 打开企业管理器,依次在控制台根目录 ->Microsoft SQL Servers->SQL Server 组,列出一部分数据库服务器。
2. 右击我们要连接的数据库服务器,选择属性,在常规选项卡点击网络配置弹出新窗口。
3. 在启用的协议区域我们选择 TCP/IP ,点击属性按钮,弹出新窗口。在这个窗口有网络协议默认值设置,我在这里看到我的默认端口是:“ 4067” (就开这里是不是1433了)。因面在使用 1433 连接数据库时出错。
kuria001
2008-10-08
打赏
举报
回复
是会出错,下个SP4就好了,我也碰到过,当时查了好久。。。
deeplyloving
2008-10-08
打赏
举报
回复
lz多给我一点分``现在拿分好辛苦
deeplyloving
2008-10-08
打赏
举报
回复
去下个sqlserver补丁包就可以了
http://download.microsoft.com/download/d/d/e/dde427eb-0296-4eac-a47c-d11a66b03816/chs_sql2kasp3.exe
dyh1981
2008-10-08
打赏
举报
回复
你是不是起了防火墙呀!关了应该没事了!我也碰过你提到的原因!
yami251139
2008-10-07
打赏
举报
回复
http://www.java2000.net/p394
这个。。。说的非常之详细。。。
landyshouguo
2008-10-07
打赏
举报
回复
关注!!!!!!!!
xuhaiyang
2008-10-07
打赏
举报
回复
升到sp4就好了
MyEclipse
连接
SQLServer
_2008_R2.
1. **
MyEclipse
与
SQLServer
连接
配置** -
MyEclipse
作为一款集成开发环境,支持多种数据库的
连接
,包括
SQLServer
。在
连接
SQLServer
2008 R2时,首先需要确保
MyEclipse
安装了相应的数据库驱动。 2. **
SQLServer
2008...
MyEclipse
连接
sql和mysql详解
2. **
连接
Eclipse 出现错误:** - **Eclipse 代码错误:** 确保所有
连接
参数正确无误。 - **SQL Server 配置错误:** 检查 SQL Server Configuration Manager 中的各项配置是否正确。 3. **TCP/IP
连接
问题:** ...
MyEclipse
连接
SQLServer
2008 问题全解
本文主要介绍如何在
MyEclipse
中解决
连接
SQLServer
2008时可能出现的问题。以下是一步步的详细步骤和注意事项: 1. **
SQLServer
2008安装**:安装
SQLServer
2008时,必须选择混合模式,允许
SQLServer
身份验证和...
MyEclipse
5.5如何
连接
SQLServer
2000
通过以下步骤,您可以轻松实现
MyEclipse
与
SQLServer
2000之间的
连接
。 #### 二、准备工作 在开始之前,请确保已经完成了以下几项准备: 1. **
SQLServer
2000的安装**:确保您的系统上已正确安装并配置了
SQLServer
...
myslipse+
sqlserver
+tomcat运行银行系统
在本项目中,我们主要涉及三个核心技术:
MyEclipse
、SQL Server和Tomcat,它们共同协作来运行一个银行系统。接下来,我们将详细讨论这三个技术及其在银行系统中的应用。 首先,
MyEclipse
是一款强大的集成开发环境...
Eclipse
58,443
社区成员
49,459
社区内容
发帖
与我相关
我的任务
Eclipse
Java Eclipse
复制链接
扫一扫
分享
社区描述
Java Eclipse
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章