<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>VTK: dox/IO/vtkSQLDatabase.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <h1>dox/IO/vtkSQLDatabase.h</h1><a href="a03194.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment">Program: Visualization Toolkit</span> <a name="l00004"></a>00004 <span class="comment">Module: $RCSfile: vtkSQLDatabase.h,v $</span> <a name="l00005"></a>00005 <span class="comment"></span> <a name="l00006"></a>00006 <span class="comment">Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen</span> <a name="l00007"></a>00007 <span class="comment">All rights reserved.</span> <a name="l00008"></a>00008 <span class="comment">See Copyright.txt or http://www.kitware.com/Copyright.htm for details.</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment">This software is distributed WITHOUT ANY WARRANTY; without even</span> <a name="l00011"></a>00011 <span class="comment">the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR</span> <a name="l00012"></a>00012 <span class="comment">PURPOSE. See the above copyright notice for more information.</span> <a name="l00013"></a>00013 <span class="comment"></span> <a name="l00014"></a>00014 <span class="comment">=========================================================================*/</span> <a name="l00015"></a>00015 <span class="comment">/*-------------------------------------------------------------------------</span> <a name="l00016"></a>00016 <span class="comment"> Copyright 2008 Sandia Corporation.</span> <a name="l00017"></a>00017 <span class="comment"> Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,</span> <a name="l00018"></a>00018 <span class="comment"> the U.S. Government retains certain rights in this software.</span> <a name="l00019"></a>00019 <span class="comment">-------------------------------------------------------------------------*/</span> <a name="l00055"></a>00055 <span class="preprocessor">#ifndef __vtkSQLDatabase_h</span> <a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define __vtkSQLDatabase_h</span> <a name="l00057"></a>00057 <span class="preprocessor"></span> <a name="l00058"></a>00058 <span class="preprocessor">#include "<a class="code" href="a02079.html">vtkObject.h</a>"</span> <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="preprocessor">#include "<a class="code" href="a02135.html">vtkStdString.h</a>"</span> <span class="comment">// Because at least one method returns a vtkStdString</span> <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keyword">class </span><a class="code" href="a01595.html" title="create a SQL database schema">vtkSQLDatabaseSchema</a>; <a name="l00063"></a>00063 <span class="keyword">class </span><a class="code" href="a01600.html" title="executes an sql query and retrieves results">vtkSQLQuery</a>; <a name="l00064"></a>00064 <span class="keyword">class </span><a class="code" href="a01619.html" title="Subclass of vtkAbstractArray that holds vtkStdStrings.">vtkStringArray</a>; <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="comment">// This is a list of features that each database may or may not</span> <a name="l00067"></a>00067 <span class="comment">// support. As yet (April 2008) we don't provide access to most of</span> <a name="l00068"></a>00068 <span class="comment">// them. </span> <a name="l00069"></a><a class="code" href="a03194.html#6fbf1141d98d7e1fd96dc27ea7a984f2">00069</a> <span class="preprocessor">#define VTK_SQL_FEATURE_TRANSACTIONS 1000</span> <a name="l00070"></a><a class="code" href="a03194.html#a49bfed4aa1fdbdca59439084b025cab">00070</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_QUERY_SIZE 1001</span> <a name="l00071"></a><a class="code" href="a03194.html#5d805c89680999737ce6da4f0808d7f2">00071</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_BLOB 1002</span> <a name="l00072"></a><a class="code" href="a03194.html#a671a9b27234922e99caa3a99c460b94">00072</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_UNICODE 1003</span> <a name="l00073"></a><a class="code" href="a03194.html#c7d5075af8d7f60064da9ad2972345ce">00073</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_PREPARED_QUERIES 1004</span> <a name="l00074"></a><a class="code" href="a03194.html#5dca6154165411b86dedf7abfe6e32cc">00074</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_NAMED_PLACEHOLDERS 1005</span> <a name="l00075"></a><a class="code" href="a03194.html#72e4ee6d42d12fba28e25445166f294a">00075</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_POSITIONAL_PLACEHOLDERS 1006</span> <a name="l00076"></a><a class="code" href="a03194.html#b80e24d22c2edcc0ba4e1aa506286c3d">00076</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_LAST_INSERT_ID 1007</span> <a name="l00077"></a><a class="code" href="a03194.html#95ded82a9fe0deecbdf7309562be37d2">00077</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_BATCH_OPERATIONS 1008</span> <a name="l00078"></a><a class="code" href="a03194.html#ef01affa13b0a2f75b57b90296d518f5">00078</a> <span class="preprocessor"></span><span class="preprocessor">#define VTK_SQL_FEATURE_TRIGGERS 1009 // supported</span> <a name="l00079"></a>00079 <span class="preprocessor"></span> <a name="l00080"></a>00080 <span class="comment">// Default size for columns types which require a size to be specified </span> <a name="l00081"></a>00081 <span class="comment">// (i.e., VARCHAR), when no size has been specified</span> <a name="l00082"></a><a class="code" href="a03194.html#515d8f5d000413df51303ca3587e7d87">00082</a> <span class="preprocessor">#define VTK_SQL_DEFAULT_COLUMN_SIZE 32</span> <a name="l00083"></a>00083 <span class="preprocessor"></span> <a name="l00084"></a><a class="code" href="a01593.html">00084</a> <span class="keyword">class </span><a class="code" href="a02170.html#aab695c81fb47ab75c91e111e17cbe2c">VTK_IO_EXPORT</a> <a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a> : <span class="keyword">public</span> <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> <a name="l00085"></a>00085 { <a name="l00086"></a>00086 <span class="keyword">public</span>: <a name="l00087"></a><a class="code" href="a01593.html#664e020df8ed1ebfdb3c4e198bcbe6ad">00087</a> vtkTypeRevisionMacro(<a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a>, <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>); <a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="a01084.html#bf3dbb4154289b56a12483eee3866263">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00089"></a>00089 <a name="l00095"></a>00095 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Open(<span class="keyword">const</span> <span class="keywordtype">char</span>* password) = 0; <a name="l00096"></a>00096 <a name="l00098"></a>00098 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Close() = 0; <a name="l00099"></a>00099 <a name="l00101"></a>00101 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> IsOpen() = 0; <a name="l00102"></a>00102 <a name="l00104"></a>00104 <span class="keyword">virtual</span> <a class="code" href="a01600.html" title="executes an sql query and retrieves results">vtkSQLQuery</a>* GetQueryInstance() = 0; <a name="l00105"></a>00105 <a name="l00107"></a>00107 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> HasError() = 0; <a name="l00108"></a>00108 <a name="l00113"></a>00113 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetLastErrorText() = 0; <a name="l00114"></a>00114 <a name="l00116"></a>00116 <span class="keyword">virtual</span> <span class="keywordtype">char</span>* GetDatabaseType() = 0; <a name="l00117"></a>00117 <a name="l00119"></a>00119 <span class="keyword">virtual</span> <a class="code" href="a01619.html" title="Subclass of vtkAbstractArray that holds vtkStdStrings.">vtkStringArray</a>* GetTables() = 0; <a name="l00120"></a>00120 <a name="l00122"></a>00122 <span class="keyword">virtual</span> <a class="code" href="a01619.html" title="Subclass of vtkAbstractArray that holds vtkStdStrings.">vtkStringArray</a>* GetRecord(<span class="keyword">const</span> <span class="keywordtype">char</span> *table) = 0; <a name="l00123"></a>00123 <a name="l00125"></a><a class="code" href="a01593.html#c431bf14411e890e8315f9665f1143a7">00125</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> IsSupported(<span class="keywordtype">int</span> vtkNotUsed(feature)) { <span class="keywordflow">return</span> <span class="keyword">false</span>; } <a name="l00126"></a>00126 <a name="l00128"></a>00128 <span class="keyword">virtual</span> <a class="code" href="a01607.html" title="Wrapper around vtkstd::string to keep symbols short.">vtkStdString</a> GetURL() = 0; <a name="l00129"></a>00129 <a name="l00134"></a><a class="code" href="a01593.html#4db0b2c395ab7518e58f1fcc00c4ef21">00134</a> <span class="keyword">virtual</span> <a class="code" href="a01607.html" title="Wrapper around vtkstd::string to keep symbols short.">vtkStdString</a> GetTablePreamble( <span class="keywordtype">bool</span> ) { <span class="keywordflow">return</span> <a class="code" href="a01607.html" title="Wrapper around vtkstd::string to keep symbols short.">vtkStdString</a>(); } <a name="l00135"></a>00135 <a name="l00137"></a>00137 <a name="l00142"></a>00142 <span class="keyword">virtual</span> <a class="code" href="a01607.html" title="Wrapper around vtkstd::string to keep symbols short.">vtkStdString</a> GetColumnSpecification( <a class="code" href="a01595.html" title="create a SQL database schema">vtkSQLDatabaseSchema</a>* schema, <a name="l00143"></a>00143 <span class="keywordtype">int</span> tblHandle, <a name="l00144"></a>00144 <span class="keywordtype">int</span> colHandle ); <a name="l00146"></a>00146 <a name="l00148"></a>00148 <a name="l00157"></a>00157 <span class="keyword">virtual</span> <a class="code" href="a01607.html" title="Wrapper around vtkstd::string to keep symbols short.">vtkStdString</a> GetIndexSpecification( <a class="code" href="a01595.html" title="create a SQL database schema">vtkSQLDatabaseSchema</a>* schema, <a name="l00158"></a>00158 <span class="keywordtype">int</span> tblHandle, <a name="l00159"></a>00159 <span class="keywordtype">int</span> idxHandle, <a name="l00160"></a>00160 <span class="keywordtype">bool</span>& skipped ); <a name="l00162"></a>00162 <a name="l00164"></a>00164 <a name="l00172"></a>00172 <span class="keyword">virtual</span> <a class="code" href="a01607.html" title="Wrapper around vtkstd::string to keep symbols short.">vtkStdString</a> GetTriggerSpecification( <a class="code" href="a01595.html" title="create a SQL database schema">vtkSQLDatabaseSchema</a>* schema, <a name="l00173"></a>00173 <span class="keywordtype">int</span> tblHandle, <a name="l00174"></a>00174 <span class="keywordtype">int</span> trgHandle ); <a name="l00176"></a>00176 <a name="l00181"></a>00181 <span class="keyword">static</span> <a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a>* CreateFromURL( <span class="keyword">const</span> <span class="keywordtype">char</span>* URL ); <a name="l00182"></a>00182 <a name="l00184"></a>00184 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> EffectSchema( <a class="code" href="a01595.html" title="create a SQL database schema">vtkSQLDatabaseSchema</a>*, <span class="keywordtype">bool</span> dropIfExists = <span class="keyword">false</span> ); <a name="l00185"></a>00185 <a name="l00186"></a>00186 <span class="comment">//BTX</span> <a name="l00188"></a>00188 <span class="comment"></span> <span class="keyword">typedef</span> <a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a>* (*CreateFunction)(<span class="keyword">const</span> <span class="keywordtype">char</span>* URL); <a name="l00189"></a>00189 <span class="comment">//ETX</span> <a name="l00190"></a>00190 <a name="l00192"></a>00192 <a name="l00196"></a>00196 <span class="keyword">static</span> <span class="keywordtype">void</span> RegisterCreateFromURLCallback(CreateFunction callback); <a name="l00197"></a>00197 <span class="keyword">static</span> <span class="keywordtype">void</span> UnRegisterCreateFromURLCallback(CreateFunction callback); <a name="l00198"></a>00198 <span class="keyword">static</span> <span class="keywordtype">void</span> UnRegisterAllCreateFromURLCallbacks(); <a name="l00200"></a>00200 <a name="l00201"></a>00201 <span class="comment">//BTX</span> <a name="l00202"></a>00202 <span class="keyword">protected</span>: <a name="l00203"></a>00203 <a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a>(); <a name="l00204"></a>00204 ~<a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a>(); <a name="l00205"></a>00205 <a name="l00210"></a>00210 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> ParseURL( <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2108d1d03a5a496eb7bf55ae3db958cf814">url</a> ) = 0; <a name="l00211"></a>00211 <a name="l00212"></a>00212 <span class="keyword">private</span>: <a name="l00213"></a>00213 <a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a>(<span class="keyword">const</span> <a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a> &); <span class="comment">// Not implemented.</span> <a name="l00214"></a>00214 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a01593.html" title="maintain a connection to an sql database">vtkSQLDatabase</a> &); <span class="comment">// Not implemented.</span> <a name="l00215"></a>00215 <a name="l00217"></a>00217 <a name="l00218"></a>00218 <span class="keyword">class </span>vtkCallbackVector; <a name="l00219"></a>00219 <span class="keyword">static</span> vtkCallbackVector* Callbacks; <a name="l00221"></a>00221 <span class="comment">//ETX</span> <a name="l00222"></a>00222 }; <a name="l00223"></a>00223 <a name="l00224"></a>00224 <span class="preprocessor">#endif // __vtkSQLDatabase_h</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:41 2009 for VTK by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> </body> </html>