Link to home
Start Free TrialLog in
Avatar of avi_india
avi_india

asked on

Which language is best for database probing?

Hi All,

I need to create an application which will probe the database for various properties. e.g. it will list all the related records from tables which are linked thoruh specified Foreign Key for one particular table.

What is te best language which can be used for such operations?

I have following options :

perl
Java
.Net (C-sharp/VB.net)

what are the pros/cons for using each one of these? which is best performance wise/maintenance wise/implementation wise?

Regards
Ajay

Avatar of etmendz
etmendz

You can create stored procedures to query the records.

All of these languages support connecting to the database and executing stored procedures.

The choice of language is a matter of taste, really. But if you are on a Windows platform and you are using SQL Server, you can expect .Net to perform better than the other languages. Basically, because .Net is made by the same company that created Windows: Microsoft.

Have fun.
java has a lot of classes which can wery closely manipulate the database ...
Avatar of avi_india

ASKER

hmm...

Database can be any thing - oracle/db2/sql sever/my sql/ms access

given this, now which would be beter to give a genric solution?
Your issue now then will rely more on what drivers are available and which one's you want to use. For all of these languages, you'll encounter drivers that are free and drivers that must be purchased.

If you want portability, go Java. The driver issues apply (availability, free or not).

.Net Mono (.Net on Linux, Windows, Mac OS, etc.) may be portable as well. The driver issues would still be the same.

If you know your application is to run specifically on Windows, go .Net. Again, the driver issues would still be the same.

Have fun.
can you throw some light on .Net Vs perl (pdsql) for such kind of application? I just talked to my manager. I pushed on .Net ande on perl (pdsql). Any baselines for convincing him on using .Net?

This application need to run only on Wndows.
.Net is built to perform best on Windows. Looking forward, .Net will grow as Windows grow. Support, documentation and communities are available here and there. Database support uses ADO.Net.

Perl is a great open-source language best for I/O operations and for processing/manipulating string data. Support, documentation and communities are available here and there. Database support uses Perl's DBI module and Win32 ODBC.

In both, database driver issues apply (availability, free or not)...

Since you're building an application for Windows, I recommend you go .Net.

Have fun.
drivers will not be an issue. Most probably we'll buy drivers from DataDirect. I have worked these before and I really like there performance. There support persons are also realy geat and they try to help/resolve your problem as much as is possible.

I am still keeping this question open for next two days. May be i'll get somee more poniters.. :)

Still. thanks for all the answers.. :)
If I understand you correctly you want to extract the stucture from a Database. This is a very specific task and the solution greatly depends on the database you want to querry/analyze. If you need to extract the data from a SQL Server then you should consider taking a look at the SQLDMO COM Component. With this class you can querry a SQL Server for almost everything in it. Since this is quite MS-Centric i would also suggest .NET for this specific task. But it really depends on what language you are more used to. Both languages are able to achieve what you want. So pick the one you are faster with :) (That would also be the line of argumentation i would try on my boss)

I dont know the inner structure of the other DBs so i cant really help you out on those.
have to learn both.... :).. and i think it would be easier to learn .Net then perl.. also in long run it will be better to know .Net.. what say??? :)

I have worked only in C/C++ till date.. So in that perspective also i think it is easier to learn .Net..


If you are working on an application that will run on Windows, you are in a better position to use tools that are built to work especially with Windows and its built-in features. .Net has C#.Net and C++.Net so you can leverage your existing skills and talents.

Have fun.
Why do you need to "probe the database for various properties"? Do you want a database manager? becouse you can get a free one like http://sourceforge.net/projects/phpmyadmin/ it is an open source database manager so you have a complete solution for your problem already, it is built in php that is also free from http://www.php.net will work on any platform and any database.

On the perl, Java, .Net (C-sharp/VB.net) I would have to vote highly against perl, it is easy to write, but imposible to read, very bad for maintaining, generaly both of the other are not build for perfemance but for RAD (Rapid Application Development), I am sorry to bring another tech for the equasion but as you considered perl, why not php? It's a free scripting language that is readable, maintainable, fast to learn, fast to code, and has many free helpers like in http://pear.php.net and other places on the net, and as I sayed before has a full database manager that quries all you want so you can read there code for some help

Good lack,
Hatky.
hmm... I am wondering why nobody asked this "why" question before.

You see.. we have soft data integrity i.e. we do not maintain database level integrity rather we maintain it through code. Why - This question can not be answered (but you can imagine why )...

so if the somebody has messed up with data manually - database will not stop that person from doing so. We are trying to create a utility which will probe the database for its integrity.

Well

If there are no "Hard relationships" then probing the DB wont help you out either. It will be VERY tricky to resolve these by hand. Even if you probe the DB and get all Tabels and fields, how will you relate them to each other?Also you said the DB can be anything. This will make it even harder to figure out what is correct. I hope you have a strict naming policy on your DB so you have at least a chance to link the items by their name.

Also I tend to skip the WHY question unless you are building a brand new system... I almost never got a resonable answer to the Why question.

Do you really need to probe a whole bunch of different DB systems? If its "YOUR" application i think you would be faster if you create SP that check the integrety of the DB... An automated aproach would have a lot of requirements which most likely wont be fullfilled here...

*Takes a look at our DB-Diagram..... One looooong line of tables next to each other with a tiny group at the end which was added since i work here*
gotta go now.. will give details on monday
SOLUTION
Avatar of hatky
hatky
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One of the benifits having application not defining any database level constraints is that end user can define his/her own database schema. and tell application which fields are to be used as constraints. Ofcourse it puts a big "?" on what end user would define. but with the help of support, this is taken care of evry efficiently.

Only problem is that as we do not have any database level checks, soif at some time some code fails, or some transaction fails, which we are not able to catch, will result is databse inconsistancy. But this has happens only 1 in 100000 times. (This is from the data collected from various customers over the years).

So now we are developing application to detect such discrepencies in database.

Well if you are working like this for a long time I guess you won't change that fast but I want to state some things:
1. If my system had this statistics, we would be fighting inconsisensy every 1-2hr, and we are not there around the clock and our users are.
2. Did you think about securty, malitios users trying to bug the system?

I think you can still use every soulotion presnted here,
Good luck,
Hatky.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes - We also support MS Access (now mainly because of legacy reasons)


1. - YES
2. - YES



I also agree with your recommendation. But currentnly we want to know which database areas are most susceptible for such issues.