📄 databasehandler.html
字号:
<BR> Closes the connection to the database.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.util.Map<java.lang.String,java.util.List<<A HREF="../../../../com/rapidminer/tools/jdbc/ColumnIdentifier.html" title="class in com.rapidminer.tools.jdbc">ColumnIdentifier</A>>></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#getAllTableMetaData()">getAllTableMetaData</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html" title="class in com.rapidminer.tools.jdbc">DatabaseHandler</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#getConnectedDatabaseHandler(java.lang.String, java.lang.String, java.lang.String, com.rapidminer.tools.jdbc.JDBCProperties, com.rapidminer.tools.LoggingHandler)">getConnectedDatabaseHandler</A></B>(java.lang.String databaseURL, java.lang.String username, java.lang.String password, <A HREF="../../../../com/rapidminer/tools/jdbc/JDBCProperties.html" title="class in com.rapidminer.tools.jdbc">JDBCProperties</A> properties, <A HREF="../../../../com/rapidminer/tools/LoggingHandler.html" title="interface in com.rapidminer.tools">LoggingHandler</A> logging)</CODE><BR> Returns a connected database handler instance from the given connection data.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.sql.Connection</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#getConnection()">getConnection</A></B>()</CODE><BR> Returns the connection.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#getDatabaseName(com.rapidminer.example.Attribute)">getDatabaseName</A></B>(<A HREF="../../../../com/rapidminer/example/Attribute.html" title="interface in com.rapidminer.example">Attribute</A> attribute)</CODE><BR> <B>Deprecated.</B> <I>Use the open and close quotes for identifiers from the properties instead</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../com/rapidminer/tools/jdbc/JDBCProperties.html" title="class in com.rapidminer.tools.jdbc">JDBCProperties</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#getProperties()">getProperties</A></B>()</CODE><BR> Returns the JDBC properties associated with this handler.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#getRapidMinerTypeIndex(int)">getRapidMinerTypeIndex</A></B>(int sqlType)</CODE><BR> Returns for the given SQL-type the name of the corresponding RapidMiner-Type from com.rapidminer.tools.Ontology.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.sql.ResultSet</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#query(java.lang.String)">query</A></B>(java.lang.String sqlQuery)</CODE><BR> <B>Deprecated.</B> <I>Use the method <A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#createStatement()"><CODE>createStatement()</CODE></A> instead and perform the queries explicitely since this method would not allow closing the statement</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#removeColumn(com.rapidminer.example.Attribute, java.lang.String)">removeColumn</A></B>(<A HREF="../../../../com/rapidminer/example/Attribute.html" title="interface in com.rapidminer.example">Attribute</A> attribute, java.lang.String tableName)</CODE><BR> Removes the column of the given attribute from the table with name tableName.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Field Detail</B></FONT></TH></TR></TABLE><A NAME="DEFAULT_FETCH_SIZE"><!-- --></A><H3>DEFAULT_FETCH_SIZE</H3><PRE>public static final int <B>DEFAULT_FETCH_SIZE</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.rapidminer.tools.jdbc.DatabaseHandler.DEFAULT_FETCH_SIZE">Constant Field Values</A></DL></DL><HR><A NAME="OVERWRITE_MODES"><!-- --></A><H3>OVERWRITE_MODES</H3><PRE>public static final java.lang.String[] <B>OVERWRITE_MODES</B></PRE><DL><DL></DL></DL><HR><A NAME="OVERWRITE_MODE_NONE"><!-- --></A><H3>OVERWRITE_MODE_NONE</H3><PRE>public static final int <B>OVERWRITE_MODE_NONE</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.rapidminer.tools.jdbc.DatabaseHandler.OVERWRITE_MODE_NONE">Constant Field Values</A></DL></DL><HR><A NAME="OVERWRITE_MODE_OVERWRITE"><!-- --></A><H3>OVERWRITE_MODE_OVERWRITE</H3><PRE>public static final int <B>OVERWRITE_MODE_OVERWRITE</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.rapidminer.tools.jdbc.DatabaseHandler.OVERWRITE_MODE_OVERWRITE">Constant Field Values</A></DL></DL><HR><A NAME="OVERWRITE_MODE_APPEND"><!-- --></A><H3>OVERWRITE_MODE_APPEND</H3><PRE>public static final int <B>OVERWRITE_MODE_APPEND</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.rapidminer.tools.jdbc.DatabaseHandler.OVERWRITE_MODE_APPEND">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="DatabaseHandler(java.lang.String, com.rapidminer.tools.jdbc.JDBCProperties)"><!-- --></A><H3>DatabaseHandler</H3><PRE>public <B>DatabaseHandler</B>(java.lang.String databaseURL, <A HREF="../../../../com/rapidminer/tools/jdbc/JDBCProperties.html" title="class in com.rapidminer.tools.jdbc">JDBCProperties</A> properties)</PRE><DL><DD>Constructor of the database handler. This constructor expects the URL definition of the database which is needed by the System DriverManager to create an appropriate driver. Please note that this database handler still must be connected via invoking the method <A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#connect(java.lang.String, java.lang.String, boolean)"><CODE>connect(String, String, boolean)</CODE></A>. If you want to directly use a connected database handler you might use the static method <A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html#getConnectedDatabaseHandler(java.lang.String, java.lang.String, java.lang.String, com.rapidminer.tools.jdbc.JDBCProperties, com.rapidminer.tools.LoggingHandler)"><CODE>getConnectedDatabaseHandler(String, String, String, JDBCProperties, LoggingHandler)</CODE></A> instead.<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getConnectedDatabaseHandler(java.lang.String, java.lang.String, java.lang.String, com.rapidminer.tools.jdbc.JDBCProperties, com.rapidminer.tools.LoggingHandler)"><!-- --></A><H3>getConnectedDatabaseHandler</H3><PRE>public static <A HREF="../../../../com/rapidminer/tools/jdbc/DatabaseHandler.html" title="class in com.rapidminer.tools.jdbc">DatabaseHandler</A> <B>getConnectedDatabaseHandler</B>(java.lang.String databaseURL, java.lang.String username, java.lang.String password, <A HREF="../../../../com/rapidminer/tools/jdbc/JDBCProperties.html" title="class in com.rapidminer.tools.jdbc">JDBCProperties</A> properties, <A HREF="../../../../com/rapidminer/tools/LoggingHandler.html" title="interface in com.rapidminer.tools">LoggingHandler</A> logging) throws <A HREF="../../../../com/rapidminer/operator/OperatorException.html" title="class in com.rapidminer.operator">OperatorException</A>, java.sql.SQLException</PRE><DL><DD>Returns a connected database handler instance from the given connection data. If the password is null, it will be queries by the user during this method.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/rapidminer/operator/OperatorException.html" title="class in com.rapidminer.operator">OperatorException</A></CODE><DD><CODE>java.sql.SQLException</CODE></DL></DD></DL><HR><A NAME="getProperties()"><!-- --></A><H3>getProperties</H3><PRE>public <A HREF="../../../../com/rapidminer/tools/jdbc/JDBCProperties.html" title="class in com.rapidminer.tools.jdbc">JDBCProperties</A> <B>getProperties</B>()</PRE><DL><DD>Returns the JDBC properties associated with this handler.<P><DD><DL></DL></DD></DL><HR><A NAME="connect(java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>connect</H3><PRE>public void <B>connect</B>(java.lang.String username, java.lang.String passwd, boolean autoCommit) throws java.sql.SQLException</PRE><DL><DD>Establishes a connection to the database. Afterwards, queries and updates can be executed using the methods this class provides.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - Name with which to log in to the database. Might be null.<DD><CODE>passwd</CODE> - Password with which to log in to the database. Might be null.<DD><CODE>autoCommit</CODE> - If TRUE, all changes to the database will be committed automatically. If FALSE, the commit()-Method has to be called to make changes permanent.<DT><B>Throws:</B><DD><CODE>java.sql.SQLException</CODE></DL></DD></DL><HR><A NAME="disconnect()"><!-- --></A><H3>disconnect</H3><PRE>public void <B>disconnect</B>() throws java.sql.SQLException</PRE><DL><DD>Closes the connection to the database.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.sql.SQLException</CODE></DL></DD></DL><HR><A NAME="getConnection()"><!-- --></A><H3>getConnection</H3><PRE>public java.sql.Connection <B>getConnection</B>()</PRE><DL><DD>Returns the connection. Might be used in order to create statements. The return value might be null if this database handler is not connected.<P><DD><DL></DL></DD></DL><HR><A NAME="createStatement()"><!-- --></A><H3>createStatement</H3><PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -