What is the Differences between ado and bde?
Delphi – Differences between ado and bde
adobdedelphi
Related Solutions
I don't know about Delphi 2007, but I did same thing with Delphi 7 and Oracle 8.
Here are things I did:
- Set TAdoDataSet.CursorLocation according to query:
- clUseClient if query fetches records for GUI and query is relatively "simple" - no grouping or sum
- clUseServer if query have some sort of aggregation (sum, grouping, counting)
- Set TAdoDataSet.CursorType according to query:
- ctForwardOnly for reports where you don't need scroll back through dataset - works only with clUseServer
- ctStatic for GUI. This is only mode that works with clUseClient
- Set TAdoDataSet.LockType according to query:
- ltReadOnly for every dataset that is not used for editing (grids, reports)
- ltOptimistic when records are posted to database immediately after change (e.g. user editing data on form)
- ltBatchOptimistic when you change large number of records. This is for situations where you fetch number of records, then do some processing on them and then send updates to database in batch. This works best combined with clUseClient and ctStatic.
- In my experience, Microsoft OLEDB provider for Oracle worked better than Oracle OleDb provider. You should test that.
Edit: Check Fabricio's comment about possible blob problems. - Replace TAdoQUery with TAdoDataSet. TAdoQuery was created for conversion of apps from BDE to ADO, but Borland/Codegear recomendation was to use TAdoDataSet
- Recheck Oracle connection string to be sure that you do not have network latency. How long it lasts to connect to Oracle? How long is TnsPing?
Yes it is possible to connect to MSSQL from android emulator. For example if the other system is having IP 192.168.1.2
then you can very use the same IP in your emulator to connect to the database. Anyway using JDBC in android is not encouraged. This link will explain why it not advisable to use JDBC in Android. This is how you can connect to MSSQL database using JDBC:
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
Connection conn =DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=msdibya;user=dibya;password=dibya;");
System.out.println("connected");
Statement statement=conn.createStatement();
ResultSet resultSet=statement.executeQuery("select * from [user]");
while(resultSet.next()){
System.out.println(" "+resultSet.getString(1)+" "+resultSet.getNString(2));
}
} catch (Exception e) {
e.printStackTrace();
}
I hope you have the proper jar files. Don't forget to import them.
Best Answer
As far as Delphi is concerned, ADO calls into the Microsoft supplied database drivers. BDE calls into the Borland supplied database drivers. Both ADO and BDE do a good job at basically the same thing. The BDE has not had any significant changes over the past several years, but then neither has ADO. Both have the ability to call into 3rd party ODBC drivers so can be extended.
If I were to start a new project, I would recommend using ADO over the BDE. ADO is used by a much larger universe of programmers, is supported directy by the OS vendor, and is much easier to deploy since most of the requirements are already in place. (the exception maybe specific database drivers, but you will run into that with BDE also).
Over 8 years ago, I ported one of my BDE applications completely to ADO and was never sorry. The pain was well worth the added flexiblity and ease of deployment.