Source Code Cross Referenced for dbfFileDriver.java in  » Database-DBMS » TinySQL » com » sqlmagic » tinysql » 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 » Database DBMS » TinySQL » com.sqlmagic.tinysql 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *
003:         * dbfFile/tinySQL JDBC driver
004:         *
005:         * A lot of this code is based on or directly taken from
006:         * George Reese's (borg@imaginary.com) mSQL driver.
007:         *
008:         * So, it's probably safe to say:
009:         *
010:         * Portions of this code Copyright (c) 1996 George Reese
011:         *
012:         * The rest of it:
013:         *
014:         * Copyright 1996 John Wiley & Sons, Inc. 
015:         * See the COPYING file for redistribution details.
016:         *
017:         * $Author: davis $
018:         * $Date: 2004/12/18 21:32:10 $
019:         * $Revision: 1.1 $
020:         *
021:         */
022:        package com.sqlmagic.tinysql;
023:
024:        import java.sql.Connection;
025:        import java.sql.DriverPropertyInfo;
026:        import java.sql.SQLException;
027:        import java.sql.Driver;
028:        import java.util.Properties;
029:
030:        /**
031:         dBase read/write access <br> 
032:         @author Brian Jepson <bjepson@home.com>
033:         @author Marcel Ruff <ruff@swand.lake.de> Added write access to dBase and JDK 2 support
034:         */
035:        public class dbfFileDriver extends tinySQLDriver {
036:
037:            /*
038:             *
039:             * Instantiate a new dbfFileDriver(), registering it with
040:             * the JDBC DriverManager.
041:             *
042:             */
043:            static {
044:                try {
045:                    java.sql.DriverManager.registerDriver(new dbfFileDriver());
046:                } catch (Exception e) {
047:                    e.printStackTrace();
048:                }
049:            }
050:
051:            /**
052:             *
053:             * Constructs a new dbfFileDriver
054:             *
055:             */
056:            public dbfFileDriver() {
057:                super ();
058:            }
059:
060:            /**
061:             *
062:             * returns a new dbfFileConnection object, which is cast
063:             * to a tinySQLConnection object.
064:             *
065:             * @exception SQLException when an error occurs
066:             * @param user the username - currently unused
067:             * @param url the url to the data source
068:             * @param d the Driver object.
069:             *
070:             */
071:            public tinySQLConnection getConnection(String user, String url,
072:                    Driver d) throws SQLException {
073:                if (url != (String) null) {
074:                    if (url.length() > 13)
075:                        tinySQLGlobals.readLongNames(url.substring(13));
076:                }
077:                return (tinySQLConnection) new dbfFileConnection(user, url, d);
078:            }
079:
080:            /**
081:             *
082:             * Check to see if the URL is a dbfFile URL. It should start
083:             * with jdbc:dbfFile in order to qualify.
084:             *
085:             * @param url The URL of the database.
086:             * @return True if this driver can connect to the given URL.
087:             *
088:             */
089:            public boolean acceptsURL(String url) throws SQLException {
090:
091:                // make sure the length is at least twelve
092:                // before bothering with the substring
093:                // comparison.
094:                //
095:                if (url.length() < 12) {
096:                    return false;
097:                }
098:
099:                // if everything after the jdbc: part is
100:                // dbfFile, then return true.
101:                //
102:                return url.substring(5, 12).equals("dbfFile");
103:
104:            }
105:
106:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.