Source Code Cross Referenced for DefaultBookmarksFactory.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » plugins » sqlbookmark » 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 Client » squirrel sql 2.6.5a » net.sourceforge.squirrel_sql.plugins.sqlbookmark 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sourceforge.squirrel_sql.plugins.sqlbookmark;
002:
003:        public class DefaultBookmarksFactory {
004:            private static final String[][] BOOKMARKS = {
005:
006:                    {
007:                            "crtab",
008:                            "create table ...",
009:                            "CREATE TABLE MyTable\n"
010:                                    + "(\n"
011:                                    + "   MyID1 INTEGER not null,\n"
012:                                    + "   MyID2 INTEGER not null,\n"
013:                                    + "   MyTEXT VARCHAR(20),\n"
014:                                    + "   MyDate TIMESTAMP,\n"
015:                                    + "   CONSTRAINT MyTable_PK PRIMARY KEY (MyID1,MyID2)\n"
016:                                    + ")" },
017:
018:                    { "addpk", "alter table add PK",
019:                            "ALTER TABLE MyTable ADD CONSTRAINT MyTable_PK PRIMARY KEY (MyID1,MyID2)" },
020:
021:                    { "addcol", "alter table add ...",
022:                            "ALTER TABLE MyTable ADD COLUMN MyCol Integer" },
023:
024:                    { "crix", "create index ...",
025:                            "CREATE [UNIQUE] INDEX MyTable_IX ON MyTable(MyCol1, MyCol2)" },
026:
027:                    {
028:                            "addconst",
029:                            "alter table ... add constraint ...",
030:                            "ALTER TABLE MyChild\n"
031:                                    + "ADD CONSTRAINT FK_MyParent\n"
032:                                    + "FOREIGN KEY (ParentPK1InChild, ParentPK2InChild)\n"
033:                                    + "REFERENCES MyParent (ParentPK1, ParentPK2)" },
034:
035:                    {
036:                            "selwhere",
037:                            "select where",
038:                            "SELECT MyTable.MyTEXT, MyTable.*\n"
039:                                    + "FROM MyTable\n" + "WHERE MyID1 = 1\n"
040:                                    + "  AND MyID2 = 3" },
041:
042:                    {
043:                            "join",
044:                            "select join",
045:                            "SELECT MyChild.*\n"
046:                                    + "FROM MyParent\n"
047:                                    + "[INNER | LEFT | RIGHT] JOIN MyChild ON MyParent.ParentPK1 = MyChild.ParentPK1InChild AND MyParent.ParentPK2 = MyChild.ParentPK2InChild\n"
048:                                    + "WHERE MyParent.Name = 'Mom'" },
049:
050:                    {
051:                            "group",
052:                            "group by",
053:                            "SELECT SUM(price), Author\n" + "FROM Books\n"
054:                                    + "GROUP BY Author" },
055:
056:                    {
057:                            "grouphaving",
058:                            "group by having",
059:                            "SELECT SUM(price), Author\n" + "FROM Books\n"
060:                                    + "GROUP BY Author HAVING SUM(price) > 100" },
061:
062:                    {
063:                            "casesimple",
064:                            "simple form of case",
065:                            "SELECT\n" + "CASE MyText\n"
066:                                    + "     WHEN 'One' THEN 1 \n"
067:                                    + "     WHEN 'Two' THEN 2 \n"
068:                                    + "     ELSE -1 \n" + "END\n"
069:                                    + "FROM MyTable" },
070:
071:                    {
072:                            "casesstandard",
073:                            "standard form of case",
074:                            "SELECT\n" + "CASE\n"
075:                                    + "     WHEN MyText = 'One' THEN 1 \n"
076:                                    + "     WHEN MyText = 'Two' THEN 2 \n"
077:                                    + "     ELSE -1 \n" + "END\n"
078:                                    + "FROM MyTable" },
079:
080:                    {
081:                            "insertval",
082:                            "insert values",
083:                            "INSERT INTO MyTable\n"
084:                                    + "(MyID1, MyID2, MyTEXT , MyDate) VALUES\n"
085:                                    + "(1    , 100  , 'Hello', {ts '2005-06-13 23:25:00'})" },
086:
087:                    {
088:                            "insertsel",
089:                            "insert select",
090:                            "INSERT INTO MyTable (MyID1, MyID2, MyTEXT, MyDate) \n"
091:                                    + "SELECT MyID1 + 100, MyID2 + 200 , MyTEXT || ' world', MyDate FROM MyTable" },
092:
093:                    {
094:                            "update",
095:                            "update",
096:                            "UPDATE MyTable set MyTEXT = 'Hello big world', MyDate = {ts '2005-06-13 23:36:00'}\n"
097:                                    + "WHERE MyID1 = 1" },
098:
099:                    { "delete", "delete", "DELETE FROM MyTable WHERE MyID1 = 1" },
100:
101:                    { "paramexample", "bookmark with parameters",
102:                            "SELECT * FROM MyTable WHERE MyID1 = ${Value of MyID1}" } };
103:
104:            static Bookmark[] getDefaultBookmarks() {
105:                Bookmark[] ret = new Bookmark[BOOKMARKS.length];
106:                for (int i = 0; i < BOOKMARKS.length; i++) {
107:                    ret[i] = new Bookmark(BOOKMARKS[i][0], BOOKMARKS[i][1],
108:                            BOOKMARKS[i][2]);
109:                }
110:
111:                return ret;
112:            }
113:
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.