|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
还是要自己一点一点写代码,然后编译,改错再编译好那。还有最重要的是.net的编译环境非常好,你甚是不需要了解太多工具,对于简单的系统,你可以之了解一些语法就哦了。erp|serverIhavegivenyouthesourcecode,howtoconnectwithdatabasefromjsp.thisiseasyandsimple.cutandpastethebelowcodeandmodifyaccordingtoyourrequirements.ThisisesspeciallyforthosewhohadcodingexperienceinASP.Ihavegivenproperdocumentation.
<!--firstwevetoimportthenecessarypackages-->
<!--importingpackagesstarts-->
<%@pageinfo="databasehandler"%>
<%@pageimport="java.io.*"%>
<%@pageimport="java.util.*"%>
<%@pageimport="java.sql.*"%>
<%@pageimport="javax.servlet.*"%>
<%@pageimport="javax.servlet.http.*"%>
<!--importingpackagesends-->
<%
try
{
//loadingthedrivers
//thiscodeloadsJDBD-ODBCDriver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//makingconnection
//Thesecondstepinestablishingaconnectionistohavetheappropriate
//driverconnecttotheDBMS.Thefollowinglineofcodeillustratesthe
//generalidea:
Stringurl="jdbc:odbc:test";
//where"test"isthesystemdsnname
Connectioncon=DriverManager.getConnection(url,"administrator","password");
//where"administratoristheusernameto
//accessthedatabaseandpasswordis"password"
//DriverManagersgetconnectionmethodestabilishesconnection
//withthedatabasespecifiedintheJDBCURL
//Thencreatejdbcstatement
Statementstmt=con.createStatement();
Stringquery="CREATETABLECOFFEES"+
"(COF_NAMEVARCHAR(32),"+
"SUP_IDINTEGER,"+
"PRICEFLOAT,"+
"SALESINTEGER,"+
"TOTALINTEGER)";
//Executethestatement
stmt.executeUpdate(query);
}
catch(Exceptione){}
//giveconfirmationmessage
out.println("tablecoffeescreated");
%>
你对java乐观有点盲目。java的关键就是在服务器上表现优异,而且它提供了整个开发所需要的工具。应该是说,看哪天。net有没有机会赶上java。 |
|