📄 mysqldatastore.html
字号:
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="MySQLDataStore(org.geotools.data.jdbc.ConnectionPool)"><!-- --></A><H3>MySQLDataStore</H3><PRE>public <B>MySQLDataStore</B>(<A HREF="../../../../org/geotools/data/jdbc/ConnectionPool.html" title="class in org.geotools.data.jdbc">ConnectionPool</A> connectionPool) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Basic constructor for MySQLDataStore. Requires creation of a <A HREF="../../../../org/geotools/data/jdbc/ConnectionPool.html" title="class in org.geotools.data.jdbc"><CODE>ConnectionPool</CODE></A>, which could be done similar to the following:<br> <br> <code>MySQLConnectionFactory connectionFactory = new MySQLConnectionFactory("mysqldb.geotools.org", "3306", "myCoolSchema");</code><br> <code>ConnectionPool connectionPool = connectionFactory.getConnectionPool("omcnoleg", "myTrickyPassword123");</code><br> <code>DataStore dataStore = new MySQLDataStore(connectionPool);</code><br><P><DT><B>Parameters:</B><DD><CODE>connectionPool</CODE> - a MySQL <A HREF="../../../../org/geotools/data/jdbc/ConnectionPool.html" title="class in org.geotools.data.jdbc"><CODE>ConnectionPool</CODE></A><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if the database cannot be properly accessed<DT><B>See Also:</B><DD><A HREF="../../../../org/geotools/data/jdbc/ConnectionPool.html" title="class in org.geotools.data.jdbc"><CODE>ConnectionPool</CODE></A>, <A HREF="../../../../org/geotools/data/mysql/MySQLConnectionFactory.html" title="class in org.geotools.data.mysql"><CODE>MySQLConnectionFactory</CODE></A></DL><HR><A NAME="MySQLDataStore(org.geotools.data.jdbc.ConnectionPool, java.lang.String)"><!-- --></A><H3>MySQLDataStore</H3><PRE>public <B>MySQLDataStore</B>(<A HREF="../../../../org/geotools/data/jdbc/ConnectionPool.html" title="class in org.geotools.data.jdbc">ConnectionPool</A> connectionPool, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> databaseSchemaName) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Constructor for MySQLDataStore where the database schema name is provided.<P><DT><B>Parameters:</B><DD><CODE>connectionPool</CODE> - a MySQL <A HREF="../../../../org/geotools/data/jdbc/ConnectionPool.html" title="class in org.geotools.data.jdbc"><CODE>ConnectionPool</CODE></A><DD><CODE>databaseSchemaName</CODE> - the database schema. Can be null. See the comments for the parameter schemaPattern in <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/sql/DatabaseMetaData.html#getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])" title="class or interface in java.sql"><CODE>DatabaseMetaData.getTables</CODE></A>, because databaseSchemaName behaves in the same way.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if the database cannot be properly accessed</DL><HR><A NAME="MySQLDataStore(org.geotools.data.jdbc.ConnectionPool, java.lang.String, java.lang.String)"><!-- --></A><H3>MySQLDataStore</H3><PRE>public <B>MySQLDataStore</B>(<A HREF="../../../../org/geotools/data/jdbc/ConnectionPool.html" title="class in org.geotools.data.jdbc">ConnectionPool</A> connectionPool, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> databaseSchemaName, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> namespace) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Constructor for MySQLDataStore where the database schema name is provided.<P><DT><B>Parameters:</B><DD><CODE>connectionPool</CODE> - a MySQL <A HREF="../../../../org/geotools/data/jdbc/ConnectionPool.html" title="class in org.geotools.data.jdbc"><CODE>ConnectionPool</CODE></A><DD><CODE>databaseSchemaName</CODE> - the database schema. Can be null. See the comments for the parameter schemaPattern in <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/sql/DatabaseMetaData.html#getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])" title="class or interface in java.sql"><CODE>DatabaseMetaData.getTables</CODE></A>, because databaseSchemaName behaves in the same way.<DD><CODE>namespace</CODE> - the namespace for this data store. Can be null, in which case the namespace will simply be the schema name.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if the database cannot be properly accessed</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getInstance(java.lang.String, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>getInstance</H3><PRE>public static <A HREF="../../../../org/geotools/data/mysql/MySQLDataStore.html" title="class in org.geotools.data.mysql">MySQLDataStore</A> <B>getInstance</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> host, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> schema, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> username, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> password) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/sql/SQLException.html" title="class or interface in java.sql">SQLException</A></PRE><DL><DD>A utility method for creating a MySQLDataStore from database connection parameters, using the default port (3306) for MySQL.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>host</CODE> - the host name or IP address of the database server<DD><CODE>schema</CODE> - the name of the database instance<DD><CODE>username</CODE> - the database username<DD><CODE>password</CODE> - the password corresponding to <code>username</code><DT><B>Returns:</B><DD>a MySQLDataStore for the specified parameters<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/sql/SQLException.html" title="class or interface in java.sql">SQLException</A></CODE></DL></DD></DL><HR><A NAME="getInstance(java.lang.String, int, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>getInstance</H3><PRE>public static <A HREF="../../../../org/geotools/data/mysql/MySQLDataStore.html" title="class in org.geotools.data.mysql">MySQLDataStore</A> <B>getInstance</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> host, int port, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> schema, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> username, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> password) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/sql/SQLException.html" title="class or interface in java.sql">SQLException</A></PRE><DL><DD>Utility method for creating a MySQLDataStore from database connection parameters.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>host</CODE> - the host name or IP address of the database server<DD><CODE>port</CODE> - the port number of the database<DD><CODE>schema</CODE> - the name of the database instance<DD><CODE>username</CODE> - the database username<DD><CODE>password</CODE> - the password corresponding to <code>username</code><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if the MySQLDataStore cannot be created because the database cannot be properly accessed<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/sql/SQLException.html" title="class or interface in java.sql">SQLException</A></CODE> - if a MySQL connection pool cannot be established</DL></DD></DL><HR><A NAME="getFeatureWriter(java.lang.String)"><!-- --></A><H3>getFeatureWriter</H3><PRE>public <A HREF="../../../../org/geotools/data/FeatureWriter.html" title="interface in org.geotools.data">FeatureWriter</A> <B>getFeatureWriter</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> typeName) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Utility method for getting a FeatureWriter for modifying existing features, using no feature filtering and auto-committing. Not used for adding new features.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>typeName</CODE> - the feature type name (the table name)<DT><B>Returns:</B><DD>a FeatureWriter for modifying existing features<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if the database cannot be properly accessed</DL></DD></DL><HR><A NAME="getFeatureWriterAppend(java.lang.String)"><!-- --></A><H3>getFeatureWriterAppend</H3><PRE>public <A HREF="../../../../org/geotools/data/FeatureWriter.html" title="interface in org.geotools.data">FeatureWriter</A> <B>getFeatureWriterAppend</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> typeName) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Utility method for getting a FeatureWriter for adding new features, using auto-committing. Not used for modifying existing features.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>typeName</CODE> - the feature type name (the table name)<DT><B>Returns:</B><DD>a FeatureWriter for adding new features<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if the database cannot be properly accessed</DL></DD></DL><HR><A NAME="buildAttributeType(java.sql.ResultSet)"><!-- --></A><H3>buildAttributeType</H3><PRE>protected <A HREF="../../../../org/geotools/feature/AttributeType.html" title="interface in org.geotools.feature">AttributeType</A> <B>buildAttributeType</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/sql/ResultSet.html" title="class or interface in java.sql">ResultSet</A> rs) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Constructs an AttributeType from a row in a ResultSet. The ResultSet contains the information retrieved by a call to getColumns() on the DatabaseMetaData object. This information can be used to construct an Attribute Type.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -