当前位置: 技术问答>java相关
jdk1.4是不是和sql server 2000 jdbc不兼容?
来源: 互联网 发布时间:2015-09-16
本文导语: jdk1.4.1 windows 2000 server rpc sql server 2000 rpc tomcat 4.1 dreamweaver mx jbuilder7 我用dreamweaver测试sql server 2000 jdbc时,老是说 [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported VM encoding MS936. [Microsoft][SQLServer 2000 Driver for JDBC]...
jdk1.4.1
windows 2000 server rpc
sql server 2000 rpc
tomcat 4.1
dreamweaver mx
jbuilder7
我用dreamweaver测试sql server 2000 jdbc时,老是说
[Microsoft][SQLServer 2000 Driver for JDBC]Unsupported VM encoding MS936.
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]以将设置改为简体中文。
天知道是怎么回事。
windows 2000 server rpc
sql server 2000 rpc
tomcat 4.1
dreamweaver mx
jbuilder7
我用dreamweaver测试sql server 2000 jdbc时,老是说
[Microsoft][SQLServer 2000 Driver for JDBC]Unsupported VM encoding MS936.
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]以将设置改为简体中文。
天知道是怎么回事。
|
不会啊,好用的啊!!我还用sql server 7.0呢◎
给你看我的测试程序吧!
我用的是Jcreator(注意把驱动包含进来)
如果直接用jdk的话,记得把驱动放到 jrelibext目录下啊!
import java.sql.*;
class info
{
public info(String name,String sex,String nickname,String address,String email,String qq)
{
this.name=name;
this.sex=sex;
this.nickname=nickname;
this.address=address;
this.email=email;
this.qq=qq;
}
public String getName() { return name; }
public String getSex() { return sex; }
public String getNickname() { return nickname; }
public String getAddress() { return address; }
public String getEmail() { return email; }
public String getQq() { return qq; }
public static info fromResults(ResultSet infos) throws SQLException
{
return new info(
infos.getString("name"),
infos.getString("sex"),
infos.getString("nickname"),
infos.getString("address"),
infos.getString("email"),
infos.getString("qq"));
}
public String toString()
{
return new String("名字 :" + name +
"n性别 :" + sex +
"n昵称 :" + nickname +
"n地址 :" + address +
"nEmail :" + email +
"nQq :" + qq);
}
String name;
String sex;
String nickname;
String address;
String email;
String qq;
}
public class javadata1{
public static void main(String args[]) throws SQLException,Exception{
info info1;
String st="select * from info";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=javadata";
Connection myConn =
DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=javadata","sa","");
Statement myStmt = myConn.createStatement();
ResultSet myResults = myStmt.executeQuery(st);
while (myResults.next()){
try{
System.out.println("n" + info.fromResults(myResults));
}
catch(NullPointerException e){
}
}
}
}
给你看我的测试程序吧!
我用的是Jcreator(注意把驱动包含进来)
如果直接用jdk的话,记得把驱动放到 jrelibext目录下啊!
import java.sql.*;
class info
{
public info(String name,String sex,String nickname,String address,String email,String qq)
{
this.name=name;
this.sex=sex;
this.nickname=nickname;
this.address=address;
this.email=email;
this.qq=qq;
}
public String getName() { return name; }
public String getSex() { return sex; }
public String getNickname() { return nickname; }
public String getAddress() { return address; }
public String getEmail() { return email; }
public String getQq() { return qq; }
public static info fromResults(ResultSet infos) throws SQLException
{
return new info(
infos.getString("name"),
infos.getString("sex"),
infos.getString("nickname"),
infos.getString("address"),
infos.getString("email"),
infos.getString("qq"));
}
public String toString()
{
return new String("名字 :" + name +
"n性别 :" + sex +
"n昵称 :" + nickname +
"n地址 :" + address +
"nEmail :" + email +
"nQq :" + qq);
}
String name;
String sex;
String nickname;
String address;
String email;
String qq;
}
public class javadata1{
public static void main(String args[]) throws SQLException,Exception{
info info1;
String st="select * from info";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=javadata";
Connection myConn =
DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=javadata","sa","");
Statement myStmt = myConn.createStatement();
ResultSet myResults = myStmt.executeQuery(st);
while (myResults.next()){
try{
System.out.println("n" + info.fromResults(myResults));
}
catch(NullPointerException e){
}
}
}
}
|
去找一个新的jdbc for SQL SERVER 2000
|
不会吧,俺现在就在用,好好的没什么问题