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

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:是不是SQL语句错了?!不解中... [Re:wind520sand]
wind520sand





发贴: 36
于 2005-09-18 09:29 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
这就是我的ConDB.java了,斑竹帮我看看我什么地方错的.谢谢了

package wind;
import java.sql.*;
public class ConDB
{
private String url = "jdbc:mysql://localhost:3306/first2?user=root&password=root";
private String driver = "com.mysql.jdbc.Driver";
private Connection con = null;
private ResultSet rs = null;
public ConDB()
{
  try {
Class.forName(driver).newInstance();
} catch (ClassNotFoundException ex) {
System.out.println("Classnotfound");}
catch (IllegalAccessException ex){System.out.println("");}
catch (InstantiationException ex) {
System.out.println("Instantiation");  
  }
}
public ResultSet executesql(String sql)
{
  try {
rs = null;
con = null;
con = DriverManager.getConnection(url);
Statement state = con.createStatement();
rs = state.executeQuery(sql);
}
catch (SQLException ex ){System.out.println("SQLException");}
return rs;
}
}




话题树型展开
人气 标题 作者 字数 发贴时间
2900 是不是SQL语句错了?!不解中... wind520sand 471 2005-09-17 14:50
2452 Re:是不是SQL语句错了?!不解中... chengbd 49 2005-09-18 05:24
2419 Re:是不是SQL语句错了?!不解中... Ada1979 20 2005-09-23 19:07
2464 Re:是不是SQL语句错了?!不解中... wind520sand 701 2005-09-28 09:18
2494 Re:是不是SQL语句错了?!不解中... wind520sand 1046 2005-09-18 09:29
2405 Re:是不是SQL语句错了?!不解中... wind520sand 31 2005-09-20 08:30
2412 Re:是不是SQL语句错了?!不解中... chengbd 23 2005-09-20 09:02
2320 Re:是不是SQL语句错了?!不解中... why 191 2005-09-20 12:00
2457 Re:是不是SQL语句错了?!不解中... java菜鸟2005 88 2005-09-20 15:35
2394 Re:是不是SQL语句错了?!不解中... wind520sand 30 2005-09-20 18:16
2421 Re:是不是SQL语句错了?!不解中... dennisjl 53 2005-09-22 09:40
2413 Re:是不是SQL语句错了?!不解中... 沙漠小鸟 115 2005-09-22 13:07
2620 Re:是不是SQL语句错了?!不解中... beyond1984 1422 2005-09-23 10:32

reply to postflat 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