[vtk-developers] Re: vtkSQLDatabase

Shead, Timothy tshead at sandia.gov
Wed Nov 28 11:58:00 EST 2007


> -----Original Message-----
> Also why wouldn't SetURL/GetURL be public. Am I missing something? 
> Wouldn't you want to reconnect or connect to a different 
> database? Or do you guys enforce a new database object each time? 

vtkSQLDatabase is an abstract interface.  There are concrete derivatives
for specific database implementations, such as vtkSQLiteDatabase,
vtkMySQLDatabase, etc.  The problem is that SetURL() encourages the user
to do things that can't work:

// Returns an instance of vtkSQLiteDatabase
vtkSQLDatabase* db =
vtkSQLDatabase::CreateFromURL("sqlite:///home/tshead/mydb");
// Now what?
db->SetURL("mysql://tshead@localhost:3306/myotherdb");

Cheers,
Tim




More information about the vtk-developers mailing list