Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Connnecting to data base from TPL
nirjari
[html]
result_set = 'all_customers' />
result_set ='all_customers'
iteration ='nrow'>[/html]
In this sample code, we are opening connection to data base. How is the driver fro this database loaded ?
Do we not need to load the driver ? How can we connect to database without driver ?
Thanks
Find more posts tagged with
Comments
ISCBorisB
Read Perl's DBI Module documentation, it may become clearer. Briefly:
>>How is the driver for this database loaded?
DBI makes a request through another Module, DBD. DBD actually is a collection of various DB Drivers.
DBD *knows* what drivers to use from the Database Name. This is the second piece of "data_source"
attribute or Data Source Name (DSN) in DBI vocabulary. In your sample it's "mysql".
>>Do we [...] need to load the driver?
Normally, no. iwperl distro includes DBI/DBD. As long as you have DBD-supported DB installed you'll be fine.
MySQL DB is supported.
>>How can we connect to database without driver?
You can't, not in any practical sense anyway. Sure, in theory you can use various levels of DB API to roll out
your own solution. It is far from trivial though. Chances are, you'll end up coding incomplete, not scalable, not
portable and not supported driver's fragments.