I know that ,But I do not know how to use servlet ,because of being a newer of Java technology. would you like to help me again?
then you should read sth on Servlet. You may download the tutorial from sun.java.com. oh read a book such as "java servlet programming", it's not possible to teach you everything here after that, i can show you how to communicate applet and servlet
oh read a book such as "java servlet programming",
it's not possible to teach you everything here
after that, i can show you how to communicate applet and servlet
{
theDataSource="jdbc:odbc:MyAccess";
theUser="";
thePassword="";
try
{
Class.forName("Sun.jdbc.odbc.JdbcOdbcDriver");
theConnection=DriverManager.getConnection(theDataSource,theUser,thePassword);
theStatus.setText("Status:OK");
}
catch (Exception e)
{
handleException(e);
}
}
执行SQL命令public void execSQLCommand(String command)
{
try{
theStatement=theConnection.createStatement();
theResult=theStatement.executeQuery (command);
theMetaData=theResult.getMetaData ();
int columnCount=theMetaData.getColumnCount ();
theVisits.setText("");
while(theResult.next ())
{
for(int i =1;i<=columnCount;i++)
{
String colValue=theResult.getString(i);
if(colValue==null)colValue="";
theVisits.append (colValue+";");
}
theVisits.append ("
");
}
}catch(Exception e)
{
handleException(e);
}
}
其实我觉得跟jsp访问数据库没什么差别!
而且还比较麻烦,显示的格式必须自己手写代码来完成。
I will try it, and hope all of you continue to help me.
中间服务程序<-->数据库,之间的读写用上面那位仁兄(: zmrljl(javaone) ( ) 信誉:100 )讲的。
applet<-->中间服务程序:用socket来实现。
这样做有一定的好处,不过速度会慢。
A lot of books and learning materials can be found.
数据库连接
组合数据
输出流applet 中:
连接servlet
读出流