Java Doc for SimpleDataSource.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » factory » epsg » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.referencing.factory.epsg 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.referencing.factory.epsg.SimpleDataSource

SimpleDataSource
public class SimpleDataSource implements DataSource(Code)
Open a connection to an EPSG database using DriverManager . This implementation is not suitable for uses with Java Naming and Directory (JNDI), but it provides a convenient base class for connections determined from properties files.

The default implementation doesn't make any assumption about where the properties file is located. The properties file location must be supplied at construction time. Because this base class dosn't have a no-argument constructor, it can't be registered in the META-INF/services/ directory. If such a registration is wanted (for automatic detection by org.geotools.referencing.ReferencingFactoryFinder , then users must provide a subclass with a no-argument constructor.

The properties file to be supplied at construction time shall contains the following:

Property Description Default
url The URL to the EPSG database jdbc:odbc:EPSG
schema The schema containing EPSG tables in the database
user User used to make database connections
password Password used to make database connections
driver The JDBC driver to load sun.jdbc.odbc.JdbcOdbcDriver
factory The EPSG factory to instantiate org.geotools.referencing.factory.epsg.DirectEpsgFactory

since:
   2.2
version:
   $Id: SimpleDataSource.java 26096 2007-06-29 21:45:12Z jgarnett $
author:
   Martin Desruisseaux javax.sql.DataSource ThreadedEpsgFactory



Field Summary
final protected  Propertiesproperties
     The properties used for etablishing the database connection.

Constructor Summary
public  SimpleDataSource(Properties properties)
     Constructs a data source with the specified properties.
public  SimpleDataSource(File file)
     Constructs a data source with properties loaded from the specified file.

Method Summary
public  AbstractAuthorityFactorycreateFactory(Hints hints)
     Opens a connection and creates an EPSG factory for it.
public  ConnectiongetConnection()
     Attempts to establish a connection with the data source.
public  ConnectiongetConnection(String username, String password)
     Attempts to establish a connection with the data source.
Parameters:
  username - The database user on whose behalf the connection is being made.
Parameters:
  password - The user's password.
public  PrintWritergetLogWriter()
     Retrieves the log writer.
public  intgetLoginTimeout()
     Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.
public  intgetPriority()
     Returns the priority for this data source.
public  booleanisWrapperFor(Class type)
     Not implemented.
public  voidsetLogWriter(PrintWriter out)
     Sets the log writer.
public  voidsetLoginTimeout(int seconds)
     Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.
public  Objectunwrap(Class type)
     Not implemented.

Field Detail
properties
final protected Properties properties(Code)
The properties used for etablishing the database connection. See the for the expected content. This field is never null .




Constructor Detail
SimpleDataSource
public SimpleDataSource(Properties properties)(Code)
Constructs a data source with the specified properties. The properties given to this constructor are not cloned.
Parameters:
  properties - The properties, or null for an empty set.



SimpleDataSource
public SimpleDataSource(File file) throws IOException(Code)
Constructs a data source with properties loaded from the specified file.
Parameters:
  file - The properties file to load.
throws:
  IOException - if an error occured while loading the properties file.




Method Detail
createFactory
public AbstractAuthorityFactory createFactory(Hints hints) throws SQLException(Code)
Opens a connection and creates an EPSG factory for it. The default implementation attempts to create an instance of the class specified by the "factory" key. This class shall have a constructor expecting the following arguments in that order: Hints , Connection .



getConnection
public Connection getConnection() throws SQLException(Code)
Attempts to establish a connection with the data source. A connection to the data source.
exception:
  SQLException - if a database access error occurs.



getConnection
public Connection getConnection(String username, String password) throws SQLException(Code)
Attempts to establish a connection with the data source.
Parameters:
  username - The database user on whose behalf the connection is being made.
Parameters:
  password - The user's password. A connection to the data source.
exception:
  SQLException - if a database access error occurs.



getLogWriter
public PrintWriter getLogWriter() throws SQLException(Code)
Retrieves the log writer. The default implementation delegates to the DriverManager , which returns a system-wide logger.



getLoginTimeout
public int getLoginTimeout() throws SQLException(Code)
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. The default implementation returns zero, which means that the timeout is the default system timeout .



getPriority
public int getPriority()(Code)
Returns the priority for this data source. The default implementation returns SimpleDataSource.NORMAL_PRIORITY NORMAL_PRIORITY .



isWrapperFor
public boolean isWrapperFor(Class type) throws SQLException(Code)
Not implemented. This method is defined for Java 6 compatibility only.
since:
   2.4



setLogWriter
public void setLogWriter(PrintWriter out) throws SQLException(Code)
Sets the log writer. The default implementation delegates to the DriverManager , which have a system-wide effect.



setLoginTimeout
public void setLoginTimeout(int seconds) throws SQLException(Code)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. The default implementation does nothing.



unwrap
public Object unwrap(Class type) throws SQLException(Code)
Not implemented. This method is defined for Java 6 compatibility only.
since:
   2.4



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.