UniverseUniversity


Home Projects Jobs Clientele Contact

uu


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UU code



I see. I do pass connection string to CODBCDatabase object right now to
make it work, but it's hardcoded and will be inconvenient for others. If
that's ok as a temporary solution, I'll leave it like that.


> Normally, we should have some Logon screen. The goal of the logon screen
> with ODBC is to obtain a valid DB connection. As soon as such connection
> is
> established, CODBCDatabase::connectionString() method gives you a correct
> connect string. That string can be passed to your class as regular
> std::string and used to create a new CODBCDatabase object(s).
> Alternatively,
> you can pass CDatabase&.
>
> 2007/3/5, sergey@total-knowledge.com <sergey@total-knowledge.com>:
>>
>> Since DB connection/disconnection operations are located in Model
>> classes,
>> I have a question regarding passing DSN parameters to a Model class.
>>
>> I have 2 ways to do it:
>> 1. Use ServletConfig parameters from engine.xml and pass them to Model
>> class from Servlet each time I need to connect to DB.
>> 2. Pass parameters to Model class directly.
>>
>> I think 2. is the way to go, but don't know how to pass parameters to
>> model class. Are we going to have some kind of property file to handle
>> things like that? What's the best way to do it in C++?
>>
>>
>
>
> --
> Alexey Parshin,
> http://www.sptk.net
>



Authoright © Total Knowledge: 2001-2008