jbuilder4.0中如何开发数据库应用?

javaduke 2001-01-09 09:37:00
我想在jsp中开发关于jdatastore的数据库应用,总是不好使!
jsp源文件如下:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF">

<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%

Connection c = null;
String URL = "jdbc:borland:dslocal:";
String dbUrl = "DataBBS.jds";
Statement st = null;
String FILE = "F:/workshop/Borland/DataBBS/data/data.jds";
String jds="jdbc:borland:dslocal:/F:/workshop/Borland/DataBBS/data/data.jds";

try {
// Load the Hyper Sonic SQL driver
Class.forName("com.borland.datastore.jdbc.DataStoreDriver");
//c=DriverManager.getConnection(jds,"","");
c = DriverManager.getConnection(FILE, "", "");
st = c.createStatement();
} catch(Exception e) {
out.println(e.getMessage());
return;
}

try {
st.executeUpdate("CREATE TABLE TEST (YEAR INTEGER, STATE VARCHAR(32), NAME INTEGER)");
} catch(Exception e) {
out.println(e.toString());
return;
}
%>
</body>
</html>
运行后提示:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF">

<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%

Connection c = null;
String URL = "jdbc:borland:dslocal:";
String dbUrl = "DataBBS.jds";
Statement st = null;
String FILE = "F:/workshop/Borland/DataBBS/data/data.jds";
String jds="jdbc:borland:dslocal:/F:/workshop/Borland/DataBBS/data/data.jds";

try {
// Load the Hyper Sonic SQL driver
Class.forName("com.borland.datastore.jdbc.DataStoreDriver");
//c=DriverManager.getConnection(jds,"","");
c = DriverManager.getConnection(FILE, "", "");
st = c.createStatement();
} catch(Exception e) {
out.println(e.getMessage());
return;
}

try {
st.executeUpdate("CREATE TABLE TEST (YEAR INTEGER, STATE VARCHAR(32), NAME INTEGER)");
} catch(Exception e) {
out.println(e.toString());
return;
}
%>
</body>
</html>
运行后提示:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF">

<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%

Connection c = null;
String URL = "jdbc:borland:dslocal:";
String dbUrl = "DataBBS.jds";
Statement st = null;
String FILE = "F:/workshop/Borland/DataBBS/data/data.jds";
String jds="jdbc:borland:dslocal:/F:/workshop/Borland/DataBBS/data/data.jds";

try {
// Load the Hyper Sonic SQL driver
Class.forName("com.borland.datastore.jdbc.DataStoreDriver");
//c=DriverManager.getConnection(jds,"","");
c = DriverManager.getConnection(FILE, "", "");
st = c.createStatement();
} catch(Exception e) {
out.println(e.getMessage());
return;
}

try {
st.executeUpdate("CREATE TABLE TEST (YEAR INTEGER, STATE VARCHAR(32), NAME INTEGER)");
} catch(Exception e) {
out.println(e.toString());
return;
}
%>
</body>
</html>
运行后提示:
java.sql.SQLException: No suitable driver
why????
...全文
108 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
javaduke 2001-01-16
  • 打赏
  • 举报
回复
已经搞定,在jbuilder4.0中,如果想用datastore的话,必须首先启动jdatastore server!
radish 2001-01-13
  • 打赏
  • 举报
回复
为什么不先封装一个BEAN,JDBC的驱动不对,没有合适的驱动。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧