Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate » MS SQL  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 各位大哥帮看一下 (cannot resolve symbol)
amw0007



发贴: 0
积分: 0
于 2004-02-02 13:08 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
import java.sql.*;
import javax.sql.*;
import com.microsoft.jdbc.sqlserver.*;

public class createtable
{
  Connetion conn=null;
  ResuldSet rs=null;
  StateMent stmt=null;
  String driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver";
  String connURL="jdbc:microsoft:sqlserver://jav:1433;User=sa;password=00781127;DatabaseName=sales";
  String name,age,address,email,str;
  public void LoadDriver()
  {
    try
    {
      Class.forName(driverName);
    }
    catch(ClassNotFoundException e)
    {
      System.err.printn("LoadDriver():Failed"+e.getMessage());
    }
  }
  public void Modify()
  {
    try
    {
      conn=DriverManager.getConnetion(connUrl);
      stmt=conn.createStateMent();
      str="CREATE TABLE customer(cName VARCHAR(10),cAge SMALLINT,cAddress VARCHAR(20))";
      stmt.executeUpdate(str);
      str="ALTER TABLE customer ADD cMail VARCHAR(20)";
      stmt.executeUpdate(str);
      str="INSERT INTO customer(cName,cAge,cAddress,cMail) value ('Mike',45,'nNewYork',mioen@315.net')";
      stmt.executeUpdate(str);
      str="INSERT INTO customer(cName,cAge,cAddress,cMail) value ('success',27,'yuann','fly@21cn.com')";
      stmt.executeUpdate(str);
      str="INSERT INTO customer(cName,cAge,cAddress,cMail) value ('huang',30,'guangxi','name@263.net')";
      stmt.executeUpdate(str);
      rs=stmt.executeQuery("select * from customer");
      while(rs.next())
      {
        name=rs.getString("cName");
        age=rs.getString("cAge");
        address=rs.getString("cAddress");
        email=rs.getString("cMail");
        System.out.println(name+" "+age+" "+address+" "+email);
      }
      conn.close();
      stmt.close();
      rs.close();
    }
    catch(SQLException sqle)
    {
      System.err.println(sqle.getMessage());
    }
  }
  public static void main(String args[])
  {
    createtable create=new createtable();
    create.LoadDriver();
    create.Modify();
  }

编译后出错
D:\JCreator Pro\MyProjects\apple\createtable.java:7: cannot resolve symbol
symbol : class Connetion
location: class createtable
  Connetion conn=null;
^
Connection

D:\JCreator Pro\MyProjects\apple\createtable.java:8: cannot resolve symbol
symbol : class ResuldSet
location: class createtable
  ResuldSet rs=null;
^
ResultSet

D:\JCreator Pro\MyProjects\apple\createtable.java:9: cannot resolve symbol
symbol : class StateMent
location: class createtable
  StateMent stmt=null;
^
Statement

D:\JCreator Pro\MyProjects\apple\createtable.java:21: cannot resolve symbol
symbol : method printn (java.lang.String)
location: class java.io.PrintStream
      System.err.printn("LoadDriver():Failed"+e.getMessage());
^
println

D:\JCreator Pro\MyProjects\apple\createtable.java:28: cannot resolve symbol
symbol : variable connUrl
location: class createtable
      conn=DriverManager.getConnetion(connUrl);
^
connURL

5 errors


why edited on 2004-03-29 07:41

作者 Re:各位大哥帮看一下 [Re:amw0007]
helloworld



发贴: 0
积分: 0
于 2004-02-02 13:24 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
没找到JDBC驱动



作者 Re:各位大哥帮看一下 [Re:amw0007]
leowu2000



版主


发贴: 258
积分: 50
于 2004-02-02 13:57 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
呵呵!你要么是键盘没有摸熟,要么就是打字飞快的那种人!:) 不过呢,错了很多单词。。。再检查检查自己敲的字符吧。

或者说你的键盘上的键很多都坏了也不一定 Tounge


why edited on 2004-05-17 00:12

Eclipse邮件列表
作者 Re:各位大哥帮看一下 [Re:amw0007]
yeehya





发贴: 9
积分: 0
于 2004-03-22 15:26 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
郁闷的人呀!


作者 Re:各位大哥帮看一下 (cannot resolve symbol) [Re:amw0007]
cityoflight



发贴: 0
积分: 0
于 2004-04-29 17:19 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
老兄是不是盲打啊Big Smile


helloworld wrote:
没找到JDBC驱动

Big Smile


why edited on 2004-05-17 00:13


flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923