请教个问题。 我在远程的服务器上 建立了一个数据库,然后通过我的机器 把内容存到 服务器上的 表格里。怎么说,数据库不存在啊??可明明是有的,存在的。
解决方案 »
- c3p0超过8小时连接mysql的问题
- mybatis配置po的XML文件的时候标签不自动出来
- http的输出流提交到servlet问题
- struts中application在servlet怎么用 能不能写出来 谢谢 把值付给applicaotion
- struts/jsp读outlook/foxmail中的联系人信息
- 现在郁闷中!哎!快郁闷死了!
- 帮忙看看这样写有问题么?
- 如何访问tomcat的管理的admin界面,在线等?
- JSP留言版中怎么使用UBBCODE呢 ?
- 有知道关于Javabeans与html的么?(高分!)
- 交流:从效率上HQL,QBE,QBC三者是一致的?
- 非常基础的问题啊,因为初学看不懂
// public static String USER_PASSWORD = "123456";
public static String USER_PASSWORD = "mindworks123456";
public static String DB_URL = "jdbc:mysql://121.14.211.22:3306/tom";
public static void saveDB(String title, String context, String summary,
String date, String url, String comefrom, String srcUrl,
String tag, int type, Connection conn) {
PreparedStatement pstmt = null;
String dbName = "tombbsData";
String spiderDate = getDate();
String sql_str = "INSERT into "
+ dbName
+ " (title,content,type,summary,createTime,url,siteName,tag,siteUrl,spiderdate)values(?,?,?,?,?,?,?,?,?,?)";
try
{
pstmt = conn.prepareStatement(sql_str);
pstmt.setString(1, title);
pstmt.setString(2, context);
pstmt.setInt(3, type);
pstmt.setString(4, summary);
// pstmt.setTimestamp(5, getPageDate(date));
pstmt.setString(5, date);
pstmt.setString(6, url);
pstmt.setString(7, comefrom);
pstmt.setString(8, tag);
pstmt.setString(9, srcUrl);
pstmt.setString(10, spiderDate);
pstmt.executeUpdate();
conn.commit();
}catch(Exception e)
{
e.printStackTrace();
try {
conn.rollback();
} catch (SQLException e1)
{
e1.printStackTrace();
}
}
finally
{
try
{
pstmt.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
那~
Table 'tom.tombbsData' doesn't exist
数据库里没这个table叻