I first learned about. net. after about three years of use, I switched to Java development.Program. When I first started using JDBC, I thought its interface was strange. The strange points are as follows:
1. preparedstatement is derived from statement, but some public methods in statement, such as execute (string SQL), cannot be called by preparedstatement instances.
2. The parameter count starts from 1, rather than 0. This is a mine. It is waiting for you to step on. People who use it initially usually step on the mine. I think the JDBC designer will laugh at this moment, haha! Another Sb recruited ......
3. The setstring () method of preparedstatement does not distinguish nchar from Char, which makes some database drivers unable to support nchar and nvarchar data. For example, the JDBC driver of Oracle 8i explicitly states that the nchar and nvachar2 types are not supported. In the driver of Oracle 9i, there is a proprietary Implementation of setformofuse (...), this problem can be solved. However, you cannot program based on the JDBC interface or change the JDBC driver.
The designer of the JDBC interface must be an expert !!
Ado. Net comes with a series of classes that support disconnected to access data, including dataset and datatable. This makes data access simple and its interfaces are easy to use. Ado. Net has the advantages of simple use of Microsoft products, and it is a bit cool as Microsoft products. One of them is that although sqlclient, oracleclient, oledb, ODBC, and other dbproviders all inherit the same interface, this does not allow you to program based on the interface in ADO. net. One of the reasons is that the parameter styles of different dbprovider SQL statements are different. SQL Server uses @ parametername-style named parameters, Oracle uses the parametername style, and oledb and ODBC both use anonymous parameters. It's a big mess !!!
In ADO. net, changing the dbprovider is not as easy as JDBC. It can be said that the openness of ADO. NET is worse than that of JDBC. Ado. NET 2.0 seems to have implemented some enhancement measures in this regard. But it is not as good as JDBC!