提交 3087c9ca 编写于 作者: J jurgen

MSSQL extension stub

Former-commit-id: 67ed206b
上级 01309bb5
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.jkiss.dbeaver.mssql.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>
bin.includes = feature.xml,\
feature.properties
featureName=DBeaver MSSQL Extension
providerName=Serge Rieder
description=DBeaver MSSQL Extension
copyright=2013, Serge Rieder
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.jkiss.dbeaver.ext.mssql"
label="%featureName"
version="1.0.0"
provider-name="%providerName"
plugin="org.jkiss.dbeaver.ext.mssql">
<description>
%description
</description>
<copyright>
%copyright
</copyright>
<license url="%licenseURL">
%license
</license>
<requires>
<import feature="org.jkiss.dbeaver.core" version="1.0.0"/>
</requires>
<plugin
id="org.jkiss.dbeaver.ext.mssql"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.mysql.jdbc"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
......@@ -20,7 +20,6 @@ Export-Package: org.apache.commons.logging,
org.jkiss.dbeaver.model.access,
org.jkiss.dbeaver.model.admin.sessions,
org.jkiss.dbeaver.model.data,
org.jkiss.dbeaver.model.data.query,
org.jkiss.dbeaver.model.edit,
org.jkiss.dbeaver.model.edit.prop,
org.jkiss.dbeaver.model.exec,
......
......@@ -97,7 +97,7 @@ public class ResultSetModel {
public void resetCellValue(GridPos cell, boolean delete)
{
if (editedValues != null && editedValues.containsKey(cell)) {
if (editedValues.containsKey(cell)) {
Object[] row = this.curRows.get(cell.row);
resetValue(row[cell.col]);
row[cell.col] = this.editedValues.get(cell);
......@@ -247,7 +247,7 @@ public class ResultSetModel {
} else {
if (dataFilter != null && dataFilter.hasFilters()) {
// This is a filtered result set so keep old metadata.
// Filtering modifies original query (adds subquery)
// Filtering modifies original query (adds sub-query)
// and it may change metadata (depends on driver)
// but actually it doesn't change any column or table names/types
// so let's keep old info
......
......@@ -83,7 +83,6 @@ import org.jkiss.dbeaver.ui.*;
import org.jkiss.dbeaver.ui.controls.lightgrid.*;
import org.jkiss.dbeaver.ui.controls.lightgrid.renderers.AbstractRenderer;
import org.jkiss.dbeaver.ui.controls.lightgrid.renderers.DefaultRowHeaderRenderer;
import org.jkiss.dbeaver.ui.controls.lightgrid.renderers.DefaultTopLeftRenderer;
import org.jkiss.dbeaver.ui.controls.spreadsheet.ISpreadsheetController;
import org.jkiss.dbeaver.ui.controls.spreadsheet.Spreadsheet;
import org.jkiss.dbeaver.ui.dialogs.ActiveWizardDialog;
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.jkiss.dbeaver.mssql</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
#Thu Dec 30 16:00:50 MSK 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
GNU General Public License
**************************
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MSSQL Plug-in
Bundle-SymbolicName: org.jkiss.dbeaver.ext.mssql;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.jkiss.dbeaver.ext.mssql.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.views,
org.eclipse.jface,
org.eclipse.jface.text,
org.jkiss.dbeaver.core,
org.eclipse.ui.workbench.texteditor,
com.mysql.jdbc
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Serge Rieder
Bundle-ClassPath: .
Bundle-Localization: plugin
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
plugin.properties,\
plugin_ru.properties, \
plugin_zh.properties, \
plugin_it.properties
# Copyright (C) 2010-2013 Serge Rieder (serge@jkiss.org)
# Copyright (C) 2012 Eugene Fradkin (eugene.fradkin@gmail.com)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dialog.connection.header=MSSQL Connection Settings
tree.databases.node.name=Databases
tree.database.node.name=Database
tree.tables.node.name=Tables
tree.table.node.name=Table
tree.columns.node.name=Columns
tree.column.node.name=Column
tree.constraints.node.name=Constraints
tree.constraint.node.name=\u0421onstraint
tree.constraint_columns.node.name=Constraint columns
tree.foreign_keys.node.name=Foreign Keys
tree.foreign_key.node.name=Foreign Key
tree.foreign_key_columns.node.name=Foreign key columns
tree.references.node.name=References
tree.reference_key.node.name=Reference Key
tree.reference_key_columns.node.name=Reference Key columns
tree.triggers.node.name=Triggers
tree.trigger.node.name=Trigger
tree.indexes.node.name=Indexes
tree.index.node.name=Index
tree.index_columns.node.name=Index columns
tree.partitions.node.name=Partitions
tree.partition.node.name=Partition
tree.subpartitions.node.name=Subpartitions
tree.subpartition.node.name=Subpartition
tree.views.node.name=Views
tree.view.node.name=View
tree.procedures.node.name=Procedures
tree.procedure.node.name=Procedure
tree.users.node.name=Users
tree.user.node.name=User
tree.administer.node.name=Administer
tree.sessions.node.name=Sessions
tree.privilege.node.name=Privilege
tree.user_privileges.node.name=User Privileges
tree.system_info.node.name=System Info
tree.session_status.node.name=Session Status
tree.variable.node.name=Variable
tree.global_status.node.name=Global Status
tree.session_variables.node.name=Session Variables
tree.global_variables.node.name=Global Variables
tree.engines.node.name=Engines
tree.engine.node.name=Engine
tree.charsets.node.name=Charsets
tree.charset.node.name=Charset
tree.collation.node.name=Collation
manager.catalog.name=Catalog manager
editor.general.name=General
editor.schema_privileges.name=Schema Privileges
editor.session_manager.name=Session Manager
editor.source.name=Source
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog.name.name=Schema Name
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog.defaultCharset.name=Default Charset
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog.defaultCollation.name=Default Collation
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog.sqlPath.name=SQL Path
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCharset.name.name=Charset
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCharset.defaultCollation.name=Default Collation
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCharset.maxLength.name=Max length
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCharset.description.name=Description
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCollation.charset.name=Charset
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCollation.name.name=Collation
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCollation.id.name=Id
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCollation.default.name=Default
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCollation.compiled.name=Compiled
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLCollation.sortLength.name=Sort length
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLEngine.name.name=Engine
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLEngine.support.name=Support
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLEngine.supportsTransactions.name=Supports Transactions
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLEngine.supportsXA.name=Supports XA
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLEngine.supportsSavepoints.name=Supports Savepoints
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLParameter.name.name=Name
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLParameter.value.name=Value
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.name.name=Partition Name
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.position.name=Position
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.method.name=Method
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.expression.name=Expression
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.description.name=Description
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.tableRows.name=Table Rows
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.avgRowLength.name=Avg Row Len
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.dataLength.name=Data Len
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.maxDataLength.name=Max Data Len
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.indexLength.name=Index Len
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.dataFree.name=Data Free
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.createTime.name=Create Time
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.updateTime.name=Update Time
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.checkTime.name=Check Time
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.checksum.name=Checksum
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.comment.name=Comment
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition.nodegroup.name=Node Group
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPrivilege.name.name=Privilege
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLPrivilege.context.name=Context
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure.procedureType.name=Procedure Type
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure.resultType.name=Result Type
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure.bodyType.name=Body Type
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure.body.name=Body
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure.clientBody.name=ClientBody
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure.deterministic.name=Deterministic
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure.deterministic.description=A routine is considered 'deterministic' if it always produces the same result for the same input parameters, and 'not deterministic' otherwise.
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure.definition.name=Definition
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedureParameter.parameterType.name=Column Type
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.engine.name=Engine
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.autoIncrement.name=Auto Increment
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.charset.name=Charset
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.collation.name=Collation
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.description.name=Description
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.rowCount.name=Row Count
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.avgRowLength.name=Avg Row Length
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.dataLength.name=Data Length
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTable$AdditionalInfo.createTime.name=Create Time
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn.typeName.name=Data Type
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn.maxLength.name=Length
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn.required.name=Not Null
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn.sequence.name=Auto Increment
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn.keyType.name=Key
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn.charset.name=Charset
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn.collation.name=Collation
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn.comment.name=Comment
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableConstraintColumn.ordinalPosition.name=Position
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableConstraintColumn.attribute.name=Column
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableForeignKeyColumnTable.referencedColumn.name=Reference Column
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableIndex.unique.name=Unique
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableIndex.description.name=Comment
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableIndexColumn.ordinalPosition.name=Position
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableIndexColumn.ascending.name=Ascending
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableIndexColumn.nullable.name=Nullable
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTableIndexColumn.tableColumn.name=Column
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTrigger.table.name=Table
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTrigger.charsetClient.name=Client Charset
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTrigger.sqlMode.name=SQL Mode
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLTrigger.sourceText.name=Definition
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLUser.name.name=User name
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLUser.host.name=Host mask
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLView$AdditionalInfo.definition.name=Definition
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLView$AdditionalInfo.checkOption.name=Check Option
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLView$AdditionalInfo.updatable.name=Updatable
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLView$AdditionalInfo.definer.name=Definer
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLView.name.name=View Name
meta.org.jkiss.dbeaver.ext.mssql.model.MSSQLView.definition.name=Definition
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.id.name=ID
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.id.description=The SELECT identifier. This is the sequential number of the SELECT within the query
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.selectType.name=Select Type
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.selectType.description=The type of SELECT
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.table.name=Table
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.table.description=The table to which the row of output refers
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.type.name=Type
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.type.description=The join type
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.possibleKeys.name=Possible Keys
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.possibleKeys.description=Indicates which indexes MSSQL can choose from use to find the rows in this table
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.key.name=Key
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.key.description=Key (index) that MSSQL actually decided to use
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.keyLength.name=Key Length
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.keyLength.description=Length of the key that MSSQL decided to use
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.ref.name=Ref
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.ref.description=Shows which columns or constants are compared to the index named in the key column to select rows from the table
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.rowCount.name=Rows
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.rowCount.description=Number of rows MSSQL believes it must examine to execute the query
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.filtered.name=Filtered
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.filtered.description=Estimated percentage of table rows that will be filtered by the table condition
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.extra.name=Extra
meta.org.jkiss.dbeaver.ext.mssql.model.plan.MSSQLPlanNode.extra.description=Additional information about how MSSQL resolves the query
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.pid.name=PID
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.pid.description=Process ID
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.user.name=User
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.user.description=Database user
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.host.name=Host
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.host.description=Remote host
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.db.name=Database
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.db.description=Database
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.command.name=Command
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.command.description=Current command
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.time.name=Time
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.time.description=Command start time
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.state.name=State
meta.org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSession.state.description=State
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<!--
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<plugin>
<extension
point="org.jkiss.dbeaver.dataSourceProvider">
<datasource
class="org.jkiss.dbeaver.ext.mssql.MSSQLDataSourceProvider"
description="MSSQL connector"
icon="icons/mssql_icon.png"
id="mssql"
label="MSSQL">
<tree
icon="icons/mssql_icon.png"
label="MSSQL data source"
path="mssql">
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog" label="%tree.databases.node.name" icon="#folder_database" description="Server databases">
<items label="%tree.database.node.name" path="database" property="catalogs" icon="#database">
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLTable" label="%tree.tables.node.name" icon="#folder_table" description="Tables">
<items label="%tree.table.node.name" path="table" property="tables" icon="#table">
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn" label="%tree.columns.node.name" icon="#columns" description="Table columns">
<items label="%tree.column.node.name" path="attribute" property="attributes" icon="#column">
</items>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLTableConstraint" label="%tree.constraints.node.name" icon="#constraints" description="Table constraints">
<items label="%tree.constraint.node.name" path="constraint" property="constraints" icon="#unique-key">
<items label="%tree.constraint_columns.node.name" path="column" property="attributeReferences" navigable="false" inline="true">
</items>
</items>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLTableForeignKey" label="%tree.foreign_keys.node.name" icon="#foreign-keys" description="Table foreign keys">
<items label="%tree.foreign_key.node.name" path="association" property="associations" icon="#foreign-key">
<items label="%tree.foreign_key_columns.node.name" itemLabel="%tree.column.node.name" path="column" property="attributeReferences" navigable="false" inline="true">
</items>
</items>
</folder>
<folder type="org.jkiss.dbeaver.model.struct.rdb.DBSTableForeignKey" label="%tree.references.node.name" icon="#references" description="Table references" virtual="true">
<items label="%tree.reference_key.node.name" path="referenceKey" property="references" icon="#reference" virtual="true">
<items label="%tree.reference_key_columns.node.name" itemLabel="%tree.column.node.name" path="column" property="attributeReferences" navigable="false" inline="true" virtual="true">
</items>
</items>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLTrigger" label="%tree.triggers.node.name" icon="#triggers" description="Triggers">
<items label="%tree.trigger.node.name" path="trigger" property="triggers" icon="#trigger">
</items>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLTableIndex" label="%tree.indexes.node.name" icon="#indexes" description="Table indexes">
<items label="%tree.index.node.name" path="index" property="indexes" icon="#index">
<items label="Index columns" itemLabel="%tree.column.node.name" path="column" property="attributeReferences" navigable="false" inline="true">
</items>
</items>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLPartition" label="%tree.partitions.node.name" icon="#partitions" description="Table partitions" visibleIf="object.dataSource.info.databaseProductVersion>='5.1.6'">
<items label="%tree.partition.node.name" path="partition" property="partitions" icon="#partition">
<items label="%tree.subpartitions.node.name" itemLabel="%tree.subpartition.node.name" path="subpartition" property="subPartitions" navigable="false" inline="true">
</items>
</items>
</folder>
</items>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLView" label="%tree.views.node.name" icon="#folder_view" description="Views">
<items label="%tree.view.node.name" path="view" property="views" icon="#view">
<items label="%tree.columns.node.name" itemLabel="%tree.column.node.name" path="column" property="attributes" icon="#column">
</items>
</items>
</folder>
<folder type="org.jkiss.dbeaver.model.struct.rdb.DBSTableIndex" label="%tree.indexes.node.name" icon="#indexes" description="Indexes" virtual="true">
<items label="%tree.index.node.name" path="index" property="indexes" icon="#index" virtual="true">
<items label="Index columns" itemLabel="%tree.column.node.name" path="column" property="attributeReferences" navigable="false" inline="true" virtual="true">
</items>
</items>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure" label="%tree.procedures.node.name" icon="#procedures" description="Procedures">
<items label="%tree.procedure.node.name" path="procedure" property="procedures" icon="#procedure">
<items label="Procedure columns" itemLabel="%tree.column.node.name" path="column" property="parameters" navigable="false" inline="true">
</items>
</items>
</folder>
<folder type="org.jkiss.dbeaver.model.struct.rdb.DBSTrigger" label="%tree.triggers.node.name" icon="#triggers" description="Triggers">
<items label="%tree.trigger.node.name" path="trigger" property="triggers" icon="#trigger">
</items>
</folder>
</items>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLUser" label="%tree.users.node.name" icon="#folder_user" description="Users">
<items label="%tree.user.node.name" path="users" property="users" icon="#user"/>
</folder>
<folder type="" label="%tree.administer.node.name" icon="#folder_admin" description="Maintenance/Settings">
<object type="org.jkiss.dbeaver.ext.mssql.editors.MSSQLSessionEditor" label="%tree.sessions.node.name" icon="#admin" description="Server session manager" editor="org.jkiss.dbeaver.ext.mssql.editors.MSSQLSessionEditor"/>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLInformation" label="%tree.system_info.node.name" icon="#folder_info" description="Database system information">
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLParameter" label="%tree.session_status.node.name" icon="#info" description="Session status">
<items label="%tree.variable.node.name" path="sessionStatus" property="sessionStatus" icon="#info" navigable="false" virtual="true"/>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLParameter" label="%tree.global_status.node.name" icon="#info" description="Global status">
<items label="%tree.variable.node.name" path="globalStatus" property="globalStatus" icon="#info" navigable="false" virtual="true"/>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLParameter" label="%tree.session_variables.node.name" icon="#info" description="Session variables">
<items label="%tree.variable.node.name" path="sessionVariables" property="sessionVariables" icon="#info" navigable="false" virtual="true"/>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLParameter" label="%tree.global_variables.node.name" icon="#info" description="Global variables">
<items label="%tree.variable.node.name" path="globalVariables" property="globalVariables" icon="#info" navigable="false" virtual="true"/>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLEngine" label="%tree.engines.node.name" icon="#info" description="Database engines">
<items label="%tree.engine.node.name" path="engines" property="engines" icon="#info" navigable="false" virtual="true"/>
</folder>
<folder type="org.jkiss.dbeaver.ext.mssql.model.MSSQLCharset" label="%tree.charsets.node.name" icon="#info" description="Database charsets">
<items label="%tree.charset.node.name" path="charsets" property="charsets" icon="#info">
<items label="%tree.collation.node.name" path="collations" property="collations" icon="#info" navigable="false"/>
</items>
</folder>
<folder type="org.jkiss.dbeaver.model.access.DBAPrivilege" label="%tree.user_privileges.node.name" icon="#info" description="User privileges">
<items label="%tree.privilege.node.name" path="privileges" property="privileges" icon="#info" navigable="false" virtual="true"/>
</folder>
</folder>
</tree>
<drivers managable="false">
<driver
id="mssql5"
label="MSSQL"
icon="icons/mssql_icon.png"
class="com.mssql.jdbc.Driver"
sampleURL="jdbc:mssql://{host}[:{port}]/[{database}]"
defaultPort="3306"
webURL="http://www.mssql.com/products/connector/"
description="MSSQL standard driver">
<file type="license" path="platform:/plugin/org.jkiss.dbeaver.ext.mssql/LICENSE.txt"/>
</driver>
</drivers>
<views>
<view
id="org.jkiss.dbeaver.ext.mssql.dataSourceWizardView"
targetID="org.jkiss.dbeaver.ext.ui.newConnectionWizard"
label="%dialog.connection.header"
class="org.jkiss.dbeaver.ext.mssql.views.MSSQLConnectionPage"
icon="icons/mssql_icon.png">
</view>
<view
id="org.jkiss.dbeaver.ext.mssql.dataSourceEditorView"
targetID="org.jkiss.dbeaver.ext.ui.editConnectionDialog"
label="%dialog.connection.header"
class="org.jkiss.dbeaver.ext.mssql.views.MSSQLConnectionPage">
</view>
</views>
</datasource>
</extension>
<extension point="org.jkiss.dbeaver.databaseEditor">
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLUserManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLUser"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLCatalogManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog"
label="%manager.catalog.name"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLTableManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLTable"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLTableColumnManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLConstraintManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLTableConstraint"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLForeignKeyManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLTableForeignKey"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLIndexManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLTableIndex"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLViewManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLView"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLTriggerManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLTrigger"/>
<manager
class="org.jkiss.dbeaver.ext.mssql.edit.MSSQLProcedureManager"
objectType="org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure"/>
<editor id="source.view" class="org.jkiss.dbeaver.ext.mssql.editors.MSSQLSourceViewEditor"
label="%editor.source.name" description="%editor.source.name" icon="#sql_text" position="additions_middle"
contributor="org.jkiss.dbeaver.ui.editors.sql.SQLEditorContributorNested" type="section">
<objectType name="org.jkiss.dbeaver.ext.mssql.model.MSSQLSourceObject"/>
</editor>
<editor id="source.ddl" class="org.jkiss.dbeaver.ext.mssql.editors.MSSQLDDLViewEditor"
label="DDL" description="DDL" icon="#sql_text" position="additions_middle"
contributor="org.jkiss.dbeaver.ui.editors.sql.SQLEditorContributorNested" type="section">
<objectType name="org.jkiss.dbeaver.ext.mssql.model.MSSQLTable"/>
</editor>
</extension>
<extension point="org.jkiss.dbeaver.dataTypeProvider">
<provider
class="org.jkiss.dbeaver.ext.mssql.data.MSSQLValueHandlerProvider"
description="MSSQL data types provider"
id="org.jkiss.dbeaver.ext.mssql.data.MSSQLValueHandlerProvider"
label="MSSQL data types provider">
<datasource id="mssql"/>
<type name="ENUM"/>
<type name="SET"/>
<type name="DATE"/>
<type name="DATETIME"/>
<type name="TIMESTAMP"/>
</provider>
</extension>
<extension point="org.eclipse.ui.editors">
<editor
name="%editor.session_manager.name"
icon="icons/sessions.png"
class="org.jkiss.dbeaver.ext.mssql.editors.MSSQLSessionEditor"
id="org.jkiss.dbeaver.ext.mssql.editors.MSSQLSessionEditor">
</editor>
</extension>
</plugin>
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.jkiss.dbeaver.ext.mssql";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
/**
* Returns an image descriptor for the image file at the given
* plug-in relative path
*
* @param path the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql;
import org.jkiss.dbeaver.model.struct.rdb.DBSIndexType;
/**
* MSSQL constants
*/
public class MSSQLConstants {
public static final int DEFAULT_PORT = 3306;
public static final String[] TABLE_TYPES = new String[]{"TABLE", "VIEW", "LOCAL TEMPORARY"};
public static final String INFO_SCHEMA_NAME = "information_schema";
public static final String MYSQL_SCHEMA_NAME = "mssql";
public static final String META_TABLE_ENGINES = INFO_SCHEMA_NAME + ".ENGINES";
public static final String META_TABLE_SCHEMATA = INFO_SCHEMA_NAME + ".SCHEMATA";
public static final String META_TABLE_TABLES = INFO_SCHEMA_NAME + ".TABLES";
public static final String META_TABLE_ROUTINES = INFO_SCHEMA_NAME + ".ROUTINES";
public static final String META_TABLE_TRIGGERS = INFO_SCHEMA_NAME + ".TRIGGERS";
public static final String META_TABLE_COLUMNS = INFO_SCHEMA_NAME + ".COLUMNS";
public static final String META_TABLE_TABLE_CONSTRAINTS = INFO_SCHEMA_NAME + ".TABLE_CONSTRAINTS";
public static final String META_TABLE_KEY_COLUMN_USAGE = INFO_SCHEMA_NAME + ".KEY_COLUMN_USAGE";
public static final String META_TABLE_STATISTICS = INFO_SCHEMA_NAME + ".STATISTICS";
public static final String META_TABLE_PARTITIONS = INFO_SCHEMA_NAME + ".PARTITIONS";
public static final String META_TABLE_VIEWS = INFO_SCHEMA_NAME + ".VIEWS";
public static final String COL_ENGINE_NAME = "ENGINE";
public static final String COL_ENGINE_SUPPORT = "SUPPORT";
public static final String COL_ENGINE_DESCRIPTION = "COMMENT";
public static final String COL_ENGINE_SUPPORT_TXN = "TRANSACTIONS";
public static final String COL_ENGINE_SUPPORT_XA = "XA";
public static final String COL_ENGINE_SUPPORT_SAVEPOINTS = "SAVEPOINTS";
public static final String COL_CATALOG_NAME = "CATALOG_NAME";
public static final String COL_SCHEMA_NAME = "SCHEMA_NAME";
public static final String COL_DEFAULT_CHARACTER_SET_NAME = "DEFAULT_CHARACTER_SET_NAME";
public static final String COL_DEFAULT_COLLATION_NAME = "DEFAULT_COLLATION_NAME";
public static final String COL_SQL_PATH = "SQL_PATH";
public static final String COL_TABLE_SCHEMA = "TABLE_SCHEMA";
public static final String COL_TABLE_NAME = "TABLE_NAME";
public static final String COL_TABLE_TYPE = "TABLE_TYPE";
public static final String COL_ENGINE = "ENGINE";
public static final String COL_VERSION = "VERSION";
public static final String COL_TABLE_ROWS = "ROWS";
public static final String COL_AUTO_INCREMENT = "AUTO_INCREMENT";
public static final String COL_TABLE_COMMENT = "COMMENT";
public static final String COL_COLUMNS_NAME = "COLUMNS_NAME";
public static final String COL_ORDINAL_POSITION = "ORDINAL_POSITION";
public static final String COL_CREATE_TIME = "CREATE_TIME";
public static final String COL_UPDATE_TIME = "UPDATE_TIME";
public static final String COL_CHECK_TIME = "CHECK_TIME";
public static final String COL_COLLATION = "COLLATION";
public static final String COL_COLLATION_NAME = "COLLATION_NAME";
public static final String COL_NULLABLE = "NULLABLE";
public static final String COL_AVG_ROW_LENGTH = "AVG_ROW_LENGTH";
public static final String COL_DATA_LENGTH = "DATA_LENGTH";
public static final String COL_INDEX_NAME = "INDEX_NAME";
public static final String COL_INDEX_TYPE = "INDEX_TYPE";
public static final String COL_SEQ_IN_INDEX = "SEQ_IN_INDEX";
public static final String COL_NON_UNIQUE = "NON_UNIQUE";
public static final String COL_COMMENT = "COMMENT";
public static final String COL_COLUMN_NAME = "COLUMN_NAME";
public static final String COL_COLUMN_KEY = "COLUMN_KEY";
public static final String COL_DATA_TYPE = "DATA_TYPE";
public static final String COL_CHARACTER_MAXIMUM_LENGTH = "CHARACTER_MAXIMUM_LENGTH";
public static final String COL_CHARACTER_OCTET_LENGTH = "CHARACTER_OCTET_LENGTH";
public static final String COL_NUMERIC_PRECISION = "NUMERIC_PRECISION";
public static final String COL_NUMERIC_SCALE = "NUMERIC_SCALE";
public static final String COL_COLUMN_DEFAULT = "COLUMN_DEFAULT";
public static final String COL_IS_NULLABLE = "IS_NULLABLE";
public static final String COL_IS_UPDATABLE = "IS_UPDATABLE";
public static final String COL_COLUMN_COMMENT = "COLUMN_COMMENT";
public static final String COL_COLUMN_EXTRA = "EXTRA";
public static final String COL_COLUMN_TYPE = "COLUMN_TYPE";
public static final String COL_ROUTINE_SCHEMA = "ROUTINE_SCHEMA";
public static final String COL_ROUTINE_NAME = "ROUTINE_NAME";
public static final String COL_ROUTINE_TYPE = "ROUTINE_TYPE";
public static final String COL_DTD_IDENTIFIER = "DTD_IDENTIFIER";
public static final String COL_ROUTINE_BODY = "ROUTINE_BODY";
public static final String COL_ROUTINE_DEFINITION = "ROUTINE_DEFINITION";
public static final String COL_EXTERNAL_NAME = "EXTERNAL_NAME";
public static final String COL_EXTERNAL_LANGUAGE = "EXTERNAL_LANGUAGE";
public static final String COL_PARAMETER_STYLE = "PARAMETER_STYLE";
public static final String COL_IS_DETERMINISTIC = "IS_DETERMINISTIC";
public static final String COL_SQL_DATA_ACCESS = "SQL_DATA_ACCESS";
public static final String COL_SECURITY_TYPE = "SECURITY_TYPE";
public static final String COL_ROUTINE_COMMENT = "ROUTINE_COMMENT";
public static final String COL_DEFINER = "DEFINER";
public static final String COL_CHARACTER_SET_CLIENT = "CHARACTER_SET_CLIENT";
public static final String COL_TRIGGER_SCHEMA = "TRIGGER_SCHEMA";
public static final String COL_TRIGGER_NAME = "TRIGGER_NAME";
public static final String COL_TRIGGER_EVENT_MANIPULATION = "EVENT_MANIPULATION";
public static final String COL_TRIGGER_EVENT_OBJECT_SCHEMA = "EVENT_OBJECT_SCHEMA";
public static final String COL_TRIGGER_EVENT_OBJECT_TABLE = "EVENT_OBJECT_TABLE";
public static final String COL_TRIGGER_ACTION_ORDER = "ACTION_ORDER";
public static final String COL_TRIGGER_ACTION_CONDITION = "ACTION_CONDITION";
public static final String COL_TRIGGER_ACTION_STATEMENT = "ACTION_STATEMENT";
public static final String COL_TRIGGER_ACTION_ORIENTATION = "ACTION_ORIENTATION";
public static final String COL_TRIGGER_ACTION_TIMING = "ACTION_TIMING";
public static final String COL_TRIGGER_SQL_MODE = "SQL_MODE";
public static final String COL_TRIGGER_DEFINER = "DEFINER";
public static final String COL_TRIGGER_CHARACTER_SET_CLIENT = "CHARACTER_SET_CLIENT";
public static final String COL_TRIGGER_COLLATION_CONNECTION = "COLLATION_CONNECTION";
public static final String COL_TRIGGER_DATABASE_COLLATION = "DATABASE_COLLATION";
public static final String COL_CONSTRAINT_NAME = "CONSTRAINT_NAME";
public static final String COL_CONSTRAINT_TYPE = "CONSTRAINT_TYPE";
public static final String CONSTRAINT_FOREIGN_KEY = "FOREIGN KEY";
public static final String CONSTRAINT_PRIMARY_KEY = "PRIMARY KEY";
public static final String CONSTRAINT_UNIQUE = "UNIQUE";
public static final String EXTRA_AUTO_INCREMENT = "auto_increment";
public static final String TYPE_NAME_ENUM = "ENUM";
public static final String TYPE_NAME_SET = "SET";
public static final DBSIndexType INDEX_TYPE_BTREE = new DBSIndexType("BTREE", "BTree");
public static final DBSIndexType INDEX_TYPE_FULLTEXT = new DBSIndexType("FULLTEXT", "Full Text");
public static final DBSIndexType INDEX_TYPE_HASH = new DBSIndexType("HASH", "Hash");
public static final DBSIndexType INDEX_TYPE_RTREE = new DBSIndexType("RTREE", "RTree");
public static final String COL_CHARSET = "CHARSET";
public static final String COL_DESCRIPTION = "DESCRIPTION";
public static final String COL_MAX_LENGTH = "MAXLENGTH";
public static final String COL_ID = "ID";
public static final String COL_DEFAULT = "DEFAULT";
public static final String COL_COMPILED = "COMPILED";
public static final String COL_SORT_LENGTH = "SORTLEN";
public static final String COL_PARTITION_NAME = "PARTITION_NAME";
public static final String COL_SUBPARTITION_NAME = "SUBPARTITION_NAME";
public static final String COL_PARTITION_ORDINAL_POSITION = "PARTITION_ORDINAL_POSITION";
public static final String COL_SUBPARTITION_ORDINAL_POSITION = "SUBPARTITION_ORDINAL_POSITION";
public static final String COL_PARTITION_METHOD = "PARTITION_METHOD";
public static final String COL_SUBPARTITION_METHOD = "SUBPARTITION_METHOD";
public static final String COL_PARTITION_EXPRESSION = "PARTITION_EXPRESSION";
public static final String COL_SUBPARTITION_EXPRESSION = "SUBPARTITION_EXPRESSION";
public static final String COL_PARTITION_DESCRIPTION = "PARTITION_DESCRIPTION";
public static final String COL_PARTITION_COMMENT = "PARTITION_COMMENT";
public static final String COL_MAX_DATA_LENGTH = "MAX_DATA_LENGTH";
public static final String COL_INDEX_LENGTH = "INDEX_LENGTH";
public static final String COL_NODEGROUP = "NODEGROUP";
public static final String COL_DATA_FREE = "DATA_FREE";
public static final String COL_CHECKSUM = "CHECKSUM";
public static final String COL_CHECK_OPTION = "CHECK_OPTION";
public static final String COL_VIEW_DEFINITION = "VIEW_DEFINITION";
}
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.core.DBeaverCore;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLDataSource;
import org.jkiss.dbeaver.model.*;
import org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSourceProvider;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.struct.DBSDataSourceContainer;
import org.jkiss.dbeaver.registry.OSDescriptor;
import org.jkiss.dbeaver.utils.WinRegistry;
import org.jkiss.utils.CommonUtils;
import java.io.File;
import java.util.*;
public class MSSQLDataSourceProvider extends JDBCDataSourceProvider implements DBPClientManager {
static final Log log = LogFactory.getLog(MSSQLDataSourceProvider.class);
private static final String REGISTRY_ROOT_32 = "SOFTWARE\\MSSQL AB";
private static final String REGISTRY_ROOT_64 = "SOFTWARE\\Wow6432Node\\MYSQL AB";
private static final String SERER_LOCATION_KEY = "Location";
//private static final String SERER_VERSION_KEY = "Version";
private static Map<String,MSSQLServerHome> localServers = null;
private static Map<String,String> connectionsProps;
static {
connectionsProps = new HashMap<String, String>();
// Prevent stupid errors "Cannot convert value '0000-00-00 00:00:00' from column X to TIMESTAMP"
// Widely appears in MyISAM tables (joomla, etc)
connectionsProps.put("zeroDateTimeBehavior", "convertToNull");
// Set utf-8 as default charset
connectionsProps.put("characterEncoding", "utf-8");
// Auth plugins
// connectionsProps.put("authenticationPlugins",
// "com.mssql.jdbc.authentication.MysqlClearPasswordPlugin," +
// "com.mssql.jdbc.authentication.MysqlOldPasswordPlugin," +
// "org.jkiss.jdbc.mssql.auth.DialogAuthenticationPlugin");
}
public static Map<String,String> getConnectionsProps() {
return connectionsProps;
}
public MSSQLDataSourceProvider()
{
}
@Override
protected String getConnectionPropertyDefaultValue(String name, String value) {
String ovrValue = connectionsProps.get(name);
return ovrValue != null ? ovrValue : super.getConnectionPropertyDefaultValue(name, value);
}
@Override
public long getFeatures()
{
return FEATURE_CATALOGS;
}
@Override
public String getConnectionURL(DBPDriver driver, DBPConnectionInfo connectionInfo)
{
return "jdbc:mssql://" + connectionInfo.getHostName() +
":" + connectionInfo.getHostPort() +
"/" + connectionInfo.getDatabaseName();
}
@Override
public DBPDataSource openDataSource(
DBRProgressMonitor monitor, DBSDataSourceContainer container)
throws DBException
{
return new MSSQLDataSource(monitor, container);
}
//////////////////////////////////////
// Client manager
@Override
public Collection<String> findClientHomeIds()
{
findLocalClients();
Set<String> homes = new LinkedHashSet<String>();
for (MSSQLServerHome home : localServers.values()) {
homes.add(home.getHomeId());
}
return homes;
}
@Override
public String getDefaultClientHomeId()
{
findLocalClients();
return localServers.isEmpty() ? null : localServers.values().iterator().next().getHomeId();
}
@Override
public DBPClientHome getClientHome(String homeId)
{
return getServerHome(homeId);
}
public static MSSQLServerHome getServerHome(String homeId)
{
findLocalClients();
MSSQLServerHome home = localServers.get(homeId);
return home == null ? new MSSQLServerHome(homeId, homeId) : home;
}
public synchronized static void findLocalClients()
{
if (localServers != null) {
return;
}
localServers = new LinkedHashMap<String, MSSQLServerHome>();
// read from path
String path = System.getenv("PATH");
if (path != null) {
for (String token : path.split(System.getProperty("path.separator"))) {
token = CommonUtils.removeTrailingSlash(token);
File mssqlFile = new File(token, MSSQLUtils.getMSSQLConsoleBinaryName());
if (mssqlFile.exists()) {
File binFolder = mssqlFile.getAbsoluteFile().getParentFile();//.getName()
if (binFolder.getName().equalsIgnoreCase("bin")) {
String homeId = CommonUtils.removeTrailingSlash(binFolder.getParentFile().getAbsolutePath());
localServers.put(homeId, new MSSQLServerHome(homeId, null));
}
}
}
}
// find homes in Windows registry
OSDescriptor localSystem = DBeaverCore.getInstance().getLocalSystem();
if (localSystem.isWindows()) {
try {
final String registryRoot = localSystem.is64() ? REGISTRY_ROOT_64 : REGISTRY_ROOT_32;
List<String> homeKeys = WinRegistry.readStringSubKeys(WinRegistry.HKEY_LOCAL_MACHINE,
registryRoot);
if (homeKeys != null) {
for (String homeKey : homeKeys) {
Map<String, String> valuesMap = WinRegistry.readStringValues(WinRegistry.HKEY_LOCAL_MACHINE, registryRoot + "\\" + homeKey);
if (valuesMap != null) {
for (String key : valuesMap.keySet()) {
if (SERER_LOCATION_KEY.equalsIgnoreCase(key)) {
String serverPath = CommonUtils.removeTrailingSlash(valuesMap.get(key));
localServers.put(serverPath, new MSSQLServerHome(serverPath, homeKey));
break;
}
}
}
}
}
} catch (Throwable e) {
log.warn("Error reading Windows registry", e);
}
}
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql;
import org.eclipse.osgi.util.NLS;
public class MSSQLMessages extends NLS {
static final String BUNDLE_NAME = "org.jkiss.dbeaver.ext.mssql.MSSQLResources"; //$NON-NLS-1$
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, MSSQLMessages.class);
}
private MSSQLMessages() {
}
public static String dialog_connection_advanced_tab;
public static String dialog_connection_advanced_tab_tooltip;
public static String dialog_connection_general_tab;
public static String dialog_connection_general_tab_tooltip;
public static String dialog_connection_host;
public static String dialog_connection_database;
public static String dialog_connection_password;
public static String dialog_connection_port;
public static String dialog_connection_test_connection;
public static String dialog_connection_user_name;
public static String edit_catalog_manager_dialog_schema_name;
public static String edit_command_change_user_action_create_new_user;
public static String edit_command_change_user_action_update_user_record;
public static String edit_command_change_user_name;
public static String edit_command_grant_privilege_action_grant_privilege;
public static String edit_command_grant_privilege_name_revoke_privilege;
public static String edit_constraint_manager_title;
public static String edit_foreign_key_manager_title;
public static String edit_index_manager_title;
public static String edit_procedure_manager_body;
public static String edit_user_manager_command_create_user;
public static String edit_user_manager_command_drop_user;
public static String edit_user_manager_command_flush_privileges;
public static String edit_view_manager_definition;
public static String editors_session_editor_action_kill_Session;
public static String editors_session_editor_action_terminate_Query;
public static String editors_session_editor_confirm;
public static String editors_user_editor_abstract_load_grants;
public static String editors_user_editor_general_control_dba_privileges;
public static String editors_user_editor_general_group_limits;
public static String editors_user_editor_general_group_login;
public static String editors_user_editor_general_label_confirm;
public static String editors_user_editor_general_label_host;
public static String editors_user_editor_general_label_password;
public static String editors_user_editor_general_label_user_name;
public static String editors_user_editor_general_service_load_catalog_privileges;
public static String editors_user_editor_general_spinner_max_connections;
public static String editors_user_editor_general_spinner_max_queries;
public static String editors_user_editor_general_spinner_max_updates;
public static String editors_user_editor_general_spinner_max_user_connections;
public static String editors_user_editor_privileges_column_catalog;
public static String editors_user_editor_privileges_column_table;
public static String editors_user_editor_privileges_control_other_privileges;
public static String editors_user_editor_privileges_control_table_privileges;
public static String editors_user_editor_privileges_group_catalogs;
public static String editors_user_editor_privileges_group_tables;
public static String editors_user_editor_privileges_service_load_privileges;
public static String editors_user_editor_privileges_service_load_tables;
public static String tools_db_export_wizard_job_dump_log_reader;
public static String tools_db_export_wizard_message_export_completed;
public static String tools_db_export_wizard_monitor_bytes;
public static String tools_db_export_wizard_monitor_export_db;
public static String tools_db_export_wizard_page_settings_checkbox_add_drop;
public static String tools_db_export_wizard_page_settings_checkbox_addnl_comments;
public static String tools_db_export_wizard_page_settings_checkbox_disable_keys;
public static String tools_db_export_wizard_page_settings_checkbox_dump_events;
public static String tools_db_export_wizard_page_settings_checkbox_ext_inserts;
public static String tools_db_export_wizard_page_settings_checkbox_no_create;
public static String tools_db_export_wizard_page_settings_combo_item_lock_tables;
public static String tools_db_export_wizard_page_settings_combo_item_normal;
public static String tools_db_export_wizard_page_settings_combo_item_online_backup;
public static String tools_db_export_wizard_page_settings_file_selector_title;
public static String tools_db_export_wizard_page_settings_group_exe_method;
public static String tools_db_export_wizard_page_settings_group_output;
public static String tools_db_export_wizard_page_settings_group_settings;
public static String tools_db_export_wizard_page_settings_label_out_text;
public static String tools_db_export_wizard_page_settings_page_description;
public static String tools_db_export_wizard_page_settings_page_name;
public static String tools_db_export_wizard_task_name;
public static String tools_db_export_wizard_title;
public static String tools_script_execute_wizard_db_import;
public static String tools_script_execute_wizard_execute_script;
public static String tools_script_execute_wizard_page_settings_group_input;
public static String tools_script_execute_wizard_page_settings_group_settings;
public static String tools_script_execute_wizard_page_settings_import_configuration;
public static String tools_script_execute_wizard_page_settings_label_input_file;
public static String tools_script_execute_wizard_page_settings_label_log_level;
public static String tools_script_execute_wizard_page_settings_script_configuration;
public static String tools_script_execute_wizard_page_settings_set_db_import_settings;
public static String tools_script_execute_wizard_page_settings_set_script_execution_settings;
}
# Copyright (C) 2010-2013 Serge Rieder (serge@jkiss.org)
# Copyright (C) 2012 Eugene Fradkin (eugene.fradkin@gmail.com)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dialog_connection_general_tab=General
dialog_connection_general_tab_tooltip=General connection properties
dialog_connection_advanced_tab=Advanced
dialog_connection_advanced_tab_tooltip=Advanced/custom driver properties
dialog_connection_host=Server Host
dialog_connection_port=Port
dialog_connection_database=Database
dialog_connection_user_name=User name
dialog_connection_password=Password
dialog_connection_test_connection=Test Connection ...
edit_catalog_manager_dialog_schema_name=Schema name
edit_command_change_user_action_create_new_user=Create new user
edit_command_change_user_action_update_user_record=Update user record
edit_command_change_user_name=Update user
edit_command_grant_privilege_action_grant_privilege=Grant privilege
edit_command_grant_privilege_name_revoke_privilege=Revoke privilege
edit_constraint_manager_title=Create constraint
edit_foreign_key_manager_title=Create foreign key
edit_index_manager_title=Create index
edit_procedure_manager_body=Body
edit_user_manager_command_create_user=Create user
edit_user_manager_command_drop_user=Drop user
edit_user_manager_command_flush_privileges=Flush privileges
edit_view_manager_definition=Definition
editors_session_editor_action_kill_Session=Kill Session
editors_session_editor_action_terminate_Query=Terminate Query
editors_session_editor_confirm={0} "{1}". Are you sure?
editors_user_editor_abstract_load_grants=Load grants
editors_user_editor_general_control_dba_privileges=DBA Privileges
editors_user_editor_general_group_limits=Limits
editors_user_editor_general_group_login=Login
editors_user_editor_general_label_confirm=Confirm
editors_user_editor_general_label_host=Host
editors_user_editor_general_label_password=Password
editors_user_editor_general_label_user_name=User Name
editors_user_editor_general_service_load_catalog_privileges=Load catalog privileges
editors_user_editor_general_spinner_max_connections=Max Connections
editors_user_editor_general_spinner_max_queries=Max Queries
editors_user_editor_general_spinner_max_updates=Max Updates
editors_user_editor_general_spinner_max_user_connections=Max User Connections
editors_user_editor_privileges_column_catalog=Catalog
editors_user_editor_privileges_column_table=Table
editors_user_editor_privileges_control_other_privileges=Other Privileges
editors_user_editor_privileges_control_table_privileges=Table Privileges
editors_user_editor_privileges_group_catalogs=Catalogs
editors_user_editor_privileges_group_tables=Tables
editors_user_editor_privileges_service_load_privileges=Load privileges
editors_user_editor_privileges_service_load_tables=Load tables
tools_db_export_wizard_job_dump_log_reader=Dump log reader
tools_db_export_wizard_message_export_completed=Database "{0}" export completed
tools_db_export_wizard_monitor_bytes={0} bytes
tools_db_export_wizard_monitor_export_db=Export database
tools_db_export_wizard_page_settings_checkbox_add_drop=Add DROP statements
tools_db_export_wizard_page_settings_checkbox_addnl_comments=Additional comments
tools_db_export_wizard_page_settings_checkbox_disable_keys=Disable keys
tools_db_export_wizard_page_settings_checkbox_dump_events=Dump events
tools_db_export_wizard_page_settings_checkbox_ext_inserts=Extended inserts
tools_db_export_wizard_page_settings_checkbox_no_create=No CREATE statements
tools_db_export_wizard_page_settings_combo_item_lock_tables=Lock all tables
tools_db_export_wizard_page_settings_combo_item_normal=Normal (no locks)
tools_db_export_wizard_page_settings_combo_item_online_backup=Online backup in single transaction
tools_db_export_wizard_page_settings_file_selector_title=Choose output file
tools_db_export_wizard_page_settings_group_exe_method=Execution Method
tools_db_export_wizard_page_settings_group_output=Output
tools_db_export_wizard_page_settings_group_settings=Settings
tools_db_export_wizard_page_settings_label_out_text=Output File
tools_db_export_wizard_page_settings_page_description=Set database export settings
tools_db_export_wizard_page_settings_page_name=Export configuration
tools_db_export_wizard_task_name=Export
tools_db_export_wizard_title=Database export
tools_script_execute_wizard_db_import=Database Import
tools_script_execute_wizard_execute_script=Execute Script
tools_script_execute_wizard_page_settings_group_input=Input
tools_script_execute_wizard_page_settings_group_settings=Settings
tools_script_execute_wizard_page_settings_import_configuration=Import configuration
tools_script_execute_wizard_page_settings_label_input_file=Input File
tools_script_execute_wizard_page_settings_label_log_level=Log Level
tools_script_execute_wizard_page_settings_script_configuration=Script configuration
tools_script_execute_wizard_page_settings_set_db_import_settings=Set database import settings
tools_script_execute_wizard_page_settings_set_script_execution_settings=Set script execution settings
# Copyright (C) 2012 Roberto Rossi (impiastro@gmail.com)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dialog_connection_general_tab = Generale
# Copyright (C) 2010-2013 Serge Rieder (serge@jkiss.org)
# Copyright (C) 2012 Eugene Fradkin (eugene.fradkin@gmail.com)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dialog_connection_advanced_tab=\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435
dialog_connection_advanced_tab_tooltip=\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435/\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430
dialog_connection_general_tab=\u041E\u0431\u0449\u0438\u0435
dialog_connection_general_tab_tooltip=\u041E\u0431\u0449\u0438\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F
dialog_connection_host=\u0421\u0435\u0440\u0432\u0435\u0440
dialog_connection_password=\u041F\u0430\u0440\u043E\u043B\u044C
dialog_connection_port=\u041F\u043E\u0440\u0442
dialog_connection_test_connection=\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 ...
dialog_connection_user_name=\u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437-\u043B\u044F
dialog_connection_database=\u0411\u0430\u0437\u0430 \u0434\u0430\u043D\u043D\u044B\u0445
edit_catalog_manager_dialog_schema_name=\u0418\u043C\u044F \u0441\u0445\u0435\u043C\u044B
edit_command_change_user_action_create_new_user=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043D\u043E\u0432\u043E\u0433\u043E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
edit_command_change_user_action_update_user_record= \u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u043F\u0438\u0441\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
edit_command_grant_privilege_action_grant_privilege=\u041F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u044E
edit_command_grant_privilege_name_revoke_privilege=\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u044E
edit_constraint_manager_title=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435
edit_foreign_key_manager_title=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u043D\u0435\u0448\u043D\u0438\u0439 \u043A\u043B\u044E\u0447
edit_index_manager_title=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0438\u043D\u0434\u0435\u043A\u0441
edit_procedure_manager_body=\u0422\u0435\u043B\u043E
edit_user_manager_command_create_user=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
edit_user_manager_command_drop_user=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
edit_view_manager_definition=\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435
edit_user_manager_command_flush_privileges="\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C" \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0438
edit_command_change_user_name=\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
editors_session_editor_action_kill_Session="\u0423\u0431\u0438\u0442\u044C" \u0441\u0435\u0441\u0441\u0438\u044E
editors_session_editor_action_terminate_Query=\u041F\u0440\u0435\u0440\u0432\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441
editors_session_editor_confirm={0} "{1}". \u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B?
editors_user_editor_abstract_load_grants=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0430
editors_user_editor_general_control_dba_privileges=DBA \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0438
editors_user_editor_general_group_limits=\u041E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F
editors_user_editor_general_group_login=\u0418\u043C\u044F
editors_user_editor_general_label_confirm=\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435
editors_user_editor_general_label_host=\u0425\u043E\u0441\u0442
editors_user_editor_general_label_password=\u041F\u0430\u0440\u043E\u043B\u044C
editors_user_editor_general_label_user_name=\u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437-\u043B\u044F
editors_user_editor_general_service_load_catalog_privileges=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0438 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430
editors_user_editor_general_spinner_max_connections=\u041C\u0430\u043A\u0441. \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0439
editors_user_editor_general_spinner_max_queries=\u041C\u0430\u043A\u0441. \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u0432
editors_user_editor_general_spinner_max_updates=\u041C\u0430\u043A\u0441. \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439
editors_user_editor_general_spinner_max_user_connections=\u041C\u0430\u043A\u0441. \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0439 \u043F\u043E\u043B\u044C\u0437-\u043B\u044F
editors_user_editor_privileges_column_catalog=\u041A\u0430\u0442\u0430\u043B\u043E\u0433
editors_user_editor_privileges_column_table=\u0422\u0430\u0431\u043B\u0438\u0446\u0430
editors_user_editor_privileges_control_other_privileges=\u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0438
editors_user_editor_privileges_control_table_privileges=\u041F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044B
editors_user_editor_privileges_group_catalogs=\u041A\u0430\u0442\u0430\u043B\u043E\u0433\u0438
editors_user_editor_privileges_group_tables=\u0422\u0430\u0431\u043B\u0438\u0446\u044B
editors_user_editor_privileges_service_load_privileges=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043F\u0440\u0438\u0432\u0438\u043B\u0435\u0433\u0438\u0438
editors_user_editor_privileges_service_load_tables=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0442\u0430\u0431\u043B\u0438\u0446\u044B
tools_db_export_wizard_job_dump_log_reader=\u0427\u0442\u0435\u043D\u0438\u0435 \u043B\u043E\u0433\u0430
tools_db_export_wizard_message_export_completed=\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445 "{0}" \u0437\u0430\u043A\u043E\u043D\u0447\u0435\u043D
tools_db_export_wizard_monitor_bytes={0} \u0431\u0430\u0439\u0442
tools_db_export_wizard_monitor_export_db=\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445
tools_db_export_wizard_page_settings_page_name=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0430
tools_db_export_wizard_page_settings_page_description=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0430 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445
tools_db_export_wizard_task_name=\u042D\u043A\u0441\u043F\u043E\u0440\u0442
tools_db_export_wizard_title=\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445
tools_db_export_wizard_page_settings_label_out_text=\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439 \u0444\u0430\u0439\u043B
tools_db_export_wizard_page_settings_group_settings=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B
tools_db_export_wizard_page_settings_group_output=\u0412\u044B\u0432\u043E\u0434
tools_db_export_wizard_page_settings_group_exe_method=\u041C\u0435\u0442\u043E\u0434 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F
tools_db_export_wizard_page_settings_file_selector_title=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u044B\u0445\u043E\u0434\u043D\u043E\u0439 \u0444\u0430\u0439\u043B
tools_db_export_wizard_page_settings_combo_item_online_backup=\u041E\u043D\u043B\u0430\u0439\u043D-\u043A\u043E\u043F\u0438\u044F \u0432 \u0435\u0434\u0438\u043D\u043E\u0439 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438
tools_db_export_wizard_page_settings_combo_item_normal=\u041D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u043E (\u0431\u0435\u0437 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043E\u043A)
tools_db_export_wizard_page_settings_combo_item_lock_tables=\u0411\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0432\u0441\u0435\u0445 \u0442\u0430\u0431\u043B\u0438\u0446
tools_db_export_wizard_page_settings_checkbox_no_create=\u0411\u0435\u0437 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u043E\u0432 CREATE
tools_db_export_wizard_page_settings_checkbox_ext_inserts=\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0435 \u0432\u0441\u0442\u0430\u0432\u043A\u0438
tools_db_export_wizard_page_settings_checkbox_disable_keys=\u0417\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u0438\u0435 \u043A\u043B\u044E\u0447\u0435\u0439
tools_db_export_wizard_page_settings_checkbox_addnl_comments=\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438
tools_db_export_wizard_page_settings_checkbox_dump_events=\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0441\u043E\u0431\u044B\u0442\u0438\u0439
tools_db_export_wizard_page_settings_checkbox_add_drop=\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u043E\u0432 DROP
tools_script_execute_wizard_db_import=\u0418\u043C\u043F\u043E\u0440\u0442 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445
tools_script_execute_wizard_execute_script=\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0441\u043A\u0440\u0438\u043F\u0442\u0430
tools_script_execute_wizard_page_settings_group_input=\u0412\u0432\u043E\u0434
tools_script_execute_wizard_page_settings_group_settings=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B
tools_script_execute_wizard_page_settings_import_configuration=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 \u0438\u043C\u043F\u043E\u0440\u0442\u0430
tools_script_execute_wizard_page_settings_label_input_file=\u0412\u0445\u043E\u0434\u043D\u043E\u0439 \u0444\u0430\u0439\u043B
tools_script_execute_wizard_page_settings_label_log_level=\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u043B\u043E\u0433\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F
tools_script_execute_wizard_page_settings_script_configuration=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0441\u043A\u0440\u0438\u043F\u0442\u0430
tools_script_execute_wizard_page_settings_set_db_import_settings=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 \u0438\u043C\u043F\u043E\u0440\u0442\u0430 \u0438\u0437 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445
tools_script_execute_wizard_page_settings_set_script_execution_settings=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 \u0438\u0441\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u0441\u043A\u0440\u0438\u043F\u0442\u0430
# Copyright (C) 2012 Brook.Tran (Brook.Tran.C@gmail.com)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dialog_connection_general_tab = \u4E00\u822C
dialog_connection_general_tab_tooltip = \u901A\u7528\u8FDE\u63A5\u5C5E\u6027
dialog_connection_advanced_tab = \u9AD8\u7EA7
dialog_connection_advanced_tab_tooltip = \u9AD8\u7EA7/\u81EA\u5B9A\u4E49 \u9A71\u52A8\u53C2\u6570
dialog_connection_host = \u670D\u52A1\u5668\u5730\u5740
dialog_connection_port = \u7AEF\u53E3
dialog_connection_database = \u6570\u636E\u5E93
dialog_connection_user_name = \u7528\u6237\u540D
dialog_connection_password = \u5BC6\u7801
dialog_connection_test_connection = \u6D4B\u8BD5\u8FDE\u63A5...
edit_catalog_manager_dialog_schema_name = \u6A21\u5F0F\u540D\u79F0
edit_command_change_user_action_create_new_user = \u521B\u5EFA\u65B0\u7528\u6237
edit_command_change_user_action_update_user_record = \u66F4\u65B0\u7528\u6237\u8BB0\u5F55
edit_command_change_user_name = \u66F4\u65B0\u7528\u6237
edit_command_grant_privilege_action_grant_privilege = \u6388\u6743
edit_command_grant_privilege_name_revoke_privilege = \u6536\u56DE\u6388\u6743
edit_constraint_manager_title = \u521B\u5EFA\u7EA6\u675F
edit_foreign_key_manager_title = \u521B\u5EFA\u5916\u952E
edit_index_manager_title = \u521B\u5EFA\u7D22\u5F15
edit_procedure_manager_body = \u5185\u5BB9
edit_user_manager_command_create_user = \u521B\u5EFA\u7528\u6237
edit_user_manager_command_drop_user = \u5220\u9664\u7528\u6237
edit_user_manager_command_flush_privileges = \u5237\u65B0\u6743\u9650
edit_view_manager_definition = \u5B9A\u4E49
editors_session_editor_action_kill_Session = \u7ED3\u675F\u4F1A\u8BDD
editors_session_editor_action_terminate_Query = \u7EC8\u6B62\u67E5\u8BE2
editors_session_editor_confirm = {0} "{1}". \u4F60\u786E\u5B9A\u5417?
editors_user_editor_abstract_load_grants = \u8F7D\u5165\u6388\u6743
editors_user_editor_general_control_dba_privileges = DBA \u6743\u9650
editors_user_editor_general_group_limits = \u9650\u5236
editors_user_editor_general_group_login = \u767B\u5F55
editors_user_editor_general_label_confirm = \u786E\u8BA4
editors_user_editor_general_label_host = \u4E3B\u673A
editors_user_editor_general_label_password = \u5BC6\u7801
editors_user_editor_general_label_user_name = \u7528\u6237\u540D
editors_user_editor_general_service_load_catalog_privileges = \u8F7D\u5165\u76EE\u5F55\u6743\u9650
editors_user_editor_general_spinner_max_connections = \u6700\u5927\u8FDE\u63A5\u6570
editors_user_editor_general_spinner_max_queries = \u6700\u5927\u67E5\u8BE2\u6570
editors_user_editor_general_spinner_max_updates = \u6700\u5927\u66F4\u65B0\u6570
editors_user_editor_general_spinner_max_user_connections = \u6700\u5927\u7528\u6237\u8FDE\u63A5\u6570
editors_user_editor_privileges_column_catalog = \u76EE\u5F55
editors_user_editor_privileges_column_table = \u8868
editors_user_editor_privileges_control_other_privileges = \u5176\u5B83\u6743\u9650
editors_user_editor_privileges_control_table_privileges = \u8868\u6743\u9650
editors_user_editor_privileges_group_catalogs = \u8868
editors_user_editor_privileges_group_tables = \u8868
editors_user_editor_privileges_service_load_privileges = \u8F7D\u5165\u6388\u6743
editors_user_editor_privileges_service_load_tables = \u8F7D\u5165\u8868
tools_db_export_wizard_job_dump_log_reader = \u8F6C\u50A8\u65E5\u5FD7\u8BFB\u53D6\u5668
tools_db_export_wizard_message_export_completed = \u6570\u636E\u5E93 "{0}" \u5BFC\u51FA\u5B8C\u6210
tools_db_export_wizard_monitor_bytes = {0} \u5B57\u8282
tools_db_export_wizard_monitor_export_db = \u5BFC\u51FA\u6570\u636E\u5E93
tools_db_export_wizard_page_settings_checkbox_add_drop = \u6DFB\u52A0 DROP \u8BED\u53E5
tools_db_export_wizard_page_settings_checkbox_addnl_comments = \u6DFB\u52A0\u6CE8\u91CA
tools_db_export_wizard_page_settings_checkbox_disable_keys = \u5C4F\u853D\u5FEB\u6377\u952E
tools_db_export_wizard_page_settings_checkbox_dump_events = \u8F6C\u5B58\u4E8B\u4EF6
tools_db_export_wizard_page_settings_checkbox_ext_inserts = \u6269\u5C55\u63D2\u5165
tools_db_export_wizard_page_settings_checkbox_no_create = \u6CA1\u6709\u627E\u5230 CREATE \u8BED\u53E5
tools_db_export_wizard_page_settings_combo_item_lock_tables = \u9501\u5B9A\u6240\u6709\u8868\u683C
tools_db_export_wizard_page_settings_combo_item_normal = \u4E00\u822C(\u6CA1\u6709\u9501\u5B9A)
tools_db_export_wizard_page_settings_combo_item_online_backup = \u5728\u7EBF\u5907\u4EFD(\u5728\u5355\u4E2A\u4E8B\u52A1\u4E2D\u8FDB\u884C)
tools_db_export_wizard_page_settings_file_selector_title = \u9009\u62E9\u8F93\u51FA\u6587\u4EF6
tools_db_export_wizard_page_settings_group_exe_method = \u6267\u884C\u65B9\u6CD5
tools_db_export_wizard_page_settings_group_output = \u8F93\u51FA
tools_db_export_wizard_page_settings_group_settings = \u8BBE\u7F6E
tools_db_export_wizard_page_settings_label_out_text = \u8F93\u51FA\u6587\u4EF6
tools_db_export_wizard_page_settings_page_description = \u8BBE\u7F6E\u6570\u636E\u5E93\u5BFC\u51FA\u53C2\u6570
tools_db_export_wizard_page_settings_page_name = \u5BFC\u51FA\u914D\u7F6E
tools_db_export_wizard_task_name = \u5BFC\u51FA
tools_db_export_wizard_title = \u5BFC\u51FA\u6570\u636E\u5E93
tools_script_execute_wizard_db_import = \u5BFC\u5165\u6570\u636E\u5E93
tools_script_execute_wizard_execute_script = \u6267\u884C\u811A\u672C
tools_script_execute_wizard_page_settings_group_input = \u8F93\u5165
tools_script_execute_wizard_page_settings_group_settings = \u8BBE\u7F6E
tools_script_execute_wizard_page_settings_import_configuration = \u5BFC\u5165\u914D\u7F6E
tools_script_execute_wizard_page_settings_label_input_file = \u8F93\u5165\u6587\u4EF6
tools_script_execute_wizard_page_settings_label_log_level = \u65E5\u5FD7\u7EA7\u522B
tools_script_execute_wizard_page_settings_script_configuration = \u811A\u672C\u914D\u7F6E
tools_script_execute_wizard_page_settings_set_db_import_settings = \u8BBE\u7F6E\u6570\u636E\u5E93\u5BFC\u5165\u53C2\u6570
tools_script_execute_wizard_page_settings_set_script_execution_settings = \u8BBE\u7F6E\u811A\u672C\u6267\u884C\u53C2\u6570
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.impl.jdbc.JDBCClientHome;
import org.jkiss.utils.IOUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
/**
* MSSQLServerHome
*/
public class MSSQLServerHome extends JDBCClientHome {
static final Log log = LogFactory.getLog(MSSQLServerHome.class);
private String name;
private String version;
protected MSSQLServerHome(String path, String name)
{
super(path, path);
this.name = name == null ? path : name;
}
@Override
public String getDisplayName()
{
return name;
}
@Override
public String getProductName() throws DBException
{
return "MSSQL";
}
@Override
public String getProductVersion() throws DBException
{
if (version == null) {
this.version = getFullServerVersion();
if (version == null) {
version = "Unknown";
}
}
return version;
}
private String getFullServerVersion()
{
String cmd = new File(
new File(getHomePath(), "bin"),
MSSQLUtils.getMSSQLConsoleBinaryName()).getAbsolutePath();
try {
Process p = Runtime.getRuntime().exec(new String[] {cmd, "-V"});
try {
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
try {
String line;
while ((line = input.readLine()) != null) {
int pos = line.indexOf("Distrib ");
if (pos != -1) {
pos += 8;
int pos2 = line.indexOf(",", pos);
return line.substring(pos, pos2);
}
}
} finally {
IOUtils.close(input);
}
} finally {
p.destroy();
}
}
catch (Exception ex) {
log.warn("Error reading MSSQL server version from " + cmd, ex);
}
return null;
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jkiss.dbeaver.model.DBPClientHome;
import org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils;
import org.jkiss.dbeaver.runtime.RuntimeUtils;
import java.io.File;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.*;
/**
* MSSQL utils
*/
public class MSSQLUtils {
static final Log log = LogFactory.getLog(MSSQLUtils.class);
private static Map<String, Integer> typeMap = new HashMap<String, Integer>();
public static final String COLUMN_POSTFIX_PRIV = "_priv";
static {
typeMap.put("BIT", java.sql.Types.BIT);
typeMap.put("TINYINT", java.sql.Types.TINYINT);
typeMap.put("SMALLINT", java.sql.Types.SMALLINT);
typeMap.put("MEDIUMINT", java.sql.Types.INTEGER);
typeMap.put("INT", java.sql.Types.INTEGER);
typeMap.put("INTEGER", java.sql.Types.INTEGER);
typeMap.put("INT24", java.sql.Types.INTEGER);
typeMap.put("BIGINT", java.sql.Types.BIGINT);
typeMap.put("REAL", java.sql.Types.DOUBLE);
typeMap.put("FLOAT", java.sql.Types.FLOAT);
typeMap.put("DECIMAL", java.sql.Types.DECIMAL);
typeMap.put("NUMERIC", java.sql.Types.DECIMAL);
typeMap.put("DOUBLE", java.sql.Types.DOUBLE);
typeMap.put("CHAR", java.sql.Types.CHAR);
typeMap.put("VARCHAR", java.sql.Types.VARCHAR);
typeMap.put("DATE", java.sql.Types.DATE);
typeMap.put("TIME", java.sql.Types.TIME);
typeMap.put("YEAR", java.sql.Types.DATE);
typeMap.put("TIMESTAMP", java.sql.Types.TIMESTAMP);
typeMap.put("DATETIME", java.sql.Types.TIMESTAMP);
typeMap.put("TINYBLOB", java.sql.Types.BINARY);
typeMap.put("BLOB", java.sql.Types.LONGVARBINARY);
typeMap.put("MEDIUMBLOB", java.sql.Types.LONGVARBINARY);
typeMap.put("LONGBLOB", java.sql.Types.LONGVARBINARY);
typeMap.put("TINYTEXT", java.sql.Types.VARCHAR);
typeMap.put("TEXT", java.sql.Types.LONGVARCHAR);
typeMap.put("MEDIUMTEXT", java.sql.Types.LONGVARCHAR);
typeMap.put("LONGTEXT", java.sql.Types.LONGVARCHAR);
typeMap.put(MSSQLConstants.TYPE_NAME_ENUM, java.sql.Types.CHAR);
typeMap.put(MSSQLConstants.TYPE_NAME_SET, java.sql.Types.CHAR);
typeMap.put("GEOMETRY", java.sql.Types.BINARY);
typeMap.put("BINARY", java.sql.Types.BINARY);
typeMap.put("VARBINARY", java.sql.Types.VARBINARY);
}
public static int typeNameToValueType(String typeName)
{
Integer valueType = typeMap.get(typeName.toUpperCase());
return valueType == null ? java.sql.Types.OTHER : valueType;
}
public static List<String> collectPrivilegeNames(ResultSet resultSet)
{
// Now collect all privileges columns
try {
List<String> privs = new ArrayList<String>();
ResultSetMetaData rsMetaData = resultSet.getMetaData();
int colCount = rsMetaData.getColumnCount();
for (int i = 0; i < colCount; i++) {
String colName = rsMetaData.getColumnName(i + 1);
if (colName.toLowerCase().endsWith(COLUMN_POSTFIX_PRIV)) {
privs.add(colName.substring(0, colName.length() - COLUMN_POSTFIX_PRIV.length()));
}
}
return privs;
} catch (SQLException e) {
log.debug(e);
return Collections.emptyList();
}
}
public static Map<String, Boolean> collectPrivileges(List<String> privNames, ResultSet resultSet)
{
// Now collect all privileges columns
Map<String, Boolean> privs = new TreeMap<String, Boolean>();
for (String privName : privNames) {
privs.put(privName, "Y".equals(JDBCUtils.safeGetString(resultSet, privName + COLUMN_POSTFIX_PRIV)));
}
return privs;
}
public static String getMSSQLConsoleBinaryName()
{
return RuntimeUtils.getNativeBinaryName("mssql");
}
public static File getHomeBinary(DBPClientHome home, String binName) throws IOException
{
binName = RuntimeUtils.getNativeBinaryName(binName);
File dumpBinary = new File(home.getHomePath(), "bin/" + binName);
if (!dumpBinary.exists()) {
dumpBinary = new File(home.getHomePath(), binName);
if (!dumpBinary.exists()) {
throw new IOException("Utility '" + binName + "' not found in MSSQL home '" + home.getDisplayName() + "'");
}
}
return dumpBinary;
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.data;
import org.jkiss.dbeaver.model.data.DBDDataFormatterProfile;
import org.jkiss.dbeaver.model.data.DBDDisplayFormat;
import org.jkiss.dbeaver.model.impl.jdbc.data.JDBCDateTimeValueHandler;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import java.util.Calendar;
import java.util.Date;
/**
* MSSQL datetime handler
*/
public class MSSQLDateTimeValueHandler extends JDBCDateTimeValueHandler {
public MSSQLDateTimeValueHandler(DBDDataFormatterProfile formatterProfile)
{
super(formatterProfile);
}
@Override
public String getValueDisplayString(DBSTypedObject column, Object value, DBDDisplayFormat format)
{
if (value instanceof Date && format == DBDDisplayFormat.NATIVE) {
Calendar cal = Calendar.getInstance();
cal.setTime((Date) value);
final String hourOfDay = getTwoDigitValue(cal.get(Calendar.HOUR_OF_DAY) + 1);
final String minutes = getTwoDigitValue(cal.get(Calendar.MINUTE));
final String seconds = getTwoDigitValue(cal.get(Calendar.SECOND));
final String year = String.valueOf(cal.get(Calendar.YEAR));
final String month = getTwoDigitValue(cal.get(Calendar.MONTH) + 1);
final String dayOfMonth = getTwoDigitValue(cal.get(Calendar.DAY_OF_MONTH));
switch (column.getTypeID()) {
case java.sql.Types.TIME:
return "STR_TO_DATE('" + hourOfDay + ":" + minutes + ":" + seconds + "','%H:%i:%s')";
case java.sql.Types.DATE:
return "STR_TO_DATE('" + year + "-" + month + "-" + dayOfMonth + "','%Y-%m-%d')";
default:
return "STR_TO_DATE('" + year + "-" + month + "-" + dayOfMonth +
" " + hourOfDay + ":" + minutes + ":" + seconds +
"','%Y-%m-%d %H:%i:%s')";
}
} else {
return super.getValueDisplayString(column, value, format);
}
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.data;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.List;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn;
import org.jkiss.dbeaver.model.DBConstants;
import org.jkiss.dbeaver.model.data.DBDDisplayFormat;
import org.jkiss.dbeaver.model.data.DBDValueController;
import org.jkiss.dbeaver.model.data.DBDValueEditor;
import org.jkiss.dbeaver.model.exec.DBCAttributeMetaData;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCExecutionContext;
import org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext;
import org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement;
import org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet;
import org.jkiss.dbeaver.model.impl.jdbc.data.JDBCAbstractValueHandler;
import org.jkiss.dbeaver.model.struct.DBSEntityAttribute;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.model.struct.rdb.DBSTableColumn;
import org.jkiss.dbeaver.ui.dialogs.data.DefaultValueViewDialog;
import org.jkiss.utils.CommonUtils;
import java.sql.SQLException;
import java.util.Collection;
/**
* MSSQL ENUM value handler
*/
public class MSSQLEnumValueHandler extends JDBCAbstractValueHandler {
public static final MSSQLEnumValueHandler INSTANCE = new MSSQLEnumValueHandler();
@Override
public Object getValueFromObject(DBCExecutionContext context, DBSTypedObject type, Object object, boolean copy) throws DBCException
{
if (object == null) {
return new MSSQLTypeEnum((MSSQLTableColumn) type, null);
} else if (object instanceof MSSQLTypeEnum) {
return copy ? new MSSQLTypeEnum((MSSQLTypeEnum) object) : object;
} else if (object instanceof String && type instanceof MSSQLTableColumn) {
return new MSSQLTypeEnum((MSSQLTableColumn) type, (String) object);
} else {
throw new DBCException("Unsupported ");
}
}
@Override
public String getValueDisplayString(DBSTypedObject column, Object value, DBDDisplayFormat format)
{
if (!(value instanceof MSSQLTypeEnum)) {
return super.getValueDisplayString(column, value, format);
}
String strValue = ((MSSQLTypeEnum) value).getValue();
return strValue == null ? DBConstants.NULL_VALUE_LABEL : strValue;
}
@Override
protected Object fetchColumnValue(
DBCExecutionContext context,
JDBCResultSet resultSet,
DBSTypedObject type,
int index)
throws SQLException
{
DBSEntityAttribute attribute = null;
if (type instanceof DBSTableColumn) {
attribute = (DBSTableColumn) type;
} else if (type instanceof DBCAttributeMetaData) {
try {
attribute = ((DBCAttributeMetaData) type).getAttribute(context.getProgressMonitor());
} catch (DBException e) {
throw new SQLException(e);
}
}
if (attribute == null) {
throw new SQLException("Could not find table column for column '" + index + "'");
}
MSSQLTableColumn enumColumn;
if (attribute instanceof MSSQLTableColumn) {
enumColumn = (MSSQLTableColumn) attribute;
} else {
throw new SQLException("Bad column type: " + attribute.getClass().getName());
}
return new MSSQLTypeEnum(enumColumn, resultSet.getString(index));
}
@Override
public void bindParameter(JDBCExecutionContext context, JDBCPreparedStatement statement, DBSTypedObject paramType, int paramIndex, Object value)
throws SQLException
{
// Sometimes we have String in value instead of MSSQLTypeEnum
// It happens when we edit result sets as MSSQL reports RS column type as CHAR for enum/set types
String strValue;
if (value instanceof MSSQLTypeEnum) {
strValue = ((MSSQLTypeEnum) value).getValue();
} else {
strValue = CommonUtils.toString(value);
}
if (strValue == null) {
statement.setNull(paramIndex, paramType.getTypeID());
} else {
statement.setString(paramIndex, strValue);
}
}
@Override
public DBDValueEditor createEditor(final DBDValueController controller)
throws DBException
{
switch (controller.getEditType()) {
case INLINE:
{
return new ValueEditor<Combo>(controller) {
@Override
public void primeEditorValue(Object value) throws DBException
{
MSSQLTypeEnum enumValue = (MSSQLTypeEnum) value;
control.setText(enumValue.isNull() ? "" : enumValue.getValue());
}
@Override
public Object extractEditorValue()
{
int selIndex = control.getSelectionIndex();
if (selIndex < 0) {
return new MSSQLTypeEnum(getColumn(), null);
} else {
return new MSSQLTypeEnum(getColumn(), control.getItem(selIndex));
}
}
@Override
protected Combo createControl(Composite editPlaceholder)
{
final Combo editor = new Combo(controller.getEditPlaceholder(), SWT.READ_ONLY);
Collection<String> enumValues = getColumn().getEnumValues();
if (enumValues != null) {
for (String enumValue : enumValues) {
editor.add(enumValue);
}
}
if (editor.getSelectionIndex() < 0) {
editor.select(0);
}
return editor;
}
private MSSQLTableColumn getColumn()
{
return ((MSSQLTypeEnum) controller.getValue()).getColumn();
}
};
}
case PANEL:
{
return new ValueEditor<List>(controller) {
@Override
public void primeEditorValue(Object value) throws DBException
{
MSSQLTypeEnum enumValue = (MSSQLTypeEnum) value;
if (enumValue.isNull()) {
control.setSelection(-1);
}
int itemCount = control.getItemCount();
for (int i = 0 ; i < itemCount; i++) {
if (control.getItem(i).equals(enumValue.getValue())) {
control.setSelection(i);
break;
}
}
}
@Override
public Object extractEditorValue()
{
int selIndex = control.getSelectionIndex();
if (selIndex < 0) {
return new MSSQLTypeEnum(getColumn(), null);
} else {
return new MSSQLTypeEnum(getColumn(), control.getItem(selIndex));
}
}
@Override
protected List createControl(Composite editPlaceholder)
{
final MSSQLTableColumn column = ((MSSQLTypeEnum) controller.getValue()).getColumn();
final List editor = new List(controller.getEditPlaceholder(), SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL);
Collection<String> enumValues = column.getEnumValues();
if (enumValues != null) {
for (String enumValue : enumValues) {
editor.add(enumValue);
}
}
if (editor.getSelectionIndex() < 0) {
editor.select(0);
}
if (controller.getEditType() == DBDValueController.EditType.INLINE) {
editor.setFocus();
}
return editor;
}
private MSSQLTableColumn getColumn()
{
return ((MSSQLTypeEnum) controller.getValue()).getColumn();
}
};
}
case EDITOR:
return new DefaultValueViewDialog(controller);
default:
return null;
}
}
@Override
public int getFeatures()
{
return FEATURE_VIEWER | FEATURE_EDITOR | FEATURE_INLINE_EDITOR;
}
@Override
public Class getValueObjectType()
{
return MSSQLTypeEnum.class;
}
/*
public void fillProperties(PropertySourceAbstract propertySource, DBDValueController controller)
{
propertySource.addProperty(
"max_length",
"Max Length",
controller.getAttributeMetaData().getMaxLength());
}
*/
}
\ No newline at end of file
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.data;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn;
import org.jkiss.dbeaver.model.data.DBDValueController;
import org.jkiss.dbeaver.model.data.DBDValueEditor;
import org.jkiss.dbeaver.ui.dialogs.data.DefaultValueViewDialog;
import org.jkiss.utils.CommonUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
* MSSQL SET value handler
*/
public class MSSQLSetValueHandler extends MSSQLEnumValueHandler {
public static final MSSQLSetValueHandler INSTANCE = new MSSQLSetValueHandler();
@Override
public DBDValueEditor createEditor(final DBDValueController controller)
throws DBException
{
switch (controller.getEditType()) {
case INLINE:
case PANEL:
final MSSQLTableColumn column = ((MSSQLTypeEnum) controller.getValue()).getColumn();
return new ValueEditor<org.eclipse.swt.widgets.List>(controller) {
@Override
public void primeEditorValue(Object value) throws DBException
{
MSSQLTypeEnum enumValue = (MSSQLTypeEnum) value;
fillSetList(control, enumValue);
}
@Override
public Object extractEditorValue()
{
String[] selection = control.getSelection();
StringBuilder resultString = new StringBuilder();
for (String selString : selection) {
if (CommonUtils.isEmpty(selString)) {
continue;
}
if (resultString.length() > 0) resultString.append(',');
resultString.append(selString);
}
return new MSSQLTypeEnum(column, resultString.toString());
}
@Override
protected org.eclipse.swt.widgets.List createControl(Composite editPlaceholder)
{
return new org.eclipse.swt.widgets.List(controller.getEditPlaceholder(), SWT.BORDER | SWT.MULTI);
}
};
case EDITOR:
return new DefaultValueViewDialog(controller);
default:
return null;
}
}
static void fillSetList(org.eclipse.swt.widgets.List editor, MSSQLTypeEnum value)
{
editor.removeAll();
List<String> enumValues = value.getColumn().getEnumValues();
String setString = value.getValue();
List<String> setValues = new ArrayList<String>();
if (!CommonUtils.isEmpty(setString)) {
StringTokenizer st = new StringTokenizer(setString, ",");
while (st.hasMoreTokens()) {
setValues.add(st.nextToken());
}
}
if (enumValues != null) {
int[] selIndices = new int[setValues.size()];
int selIndex = 0;
for (int i = 0; i < enumValues.size(); i++) {
String enumValue = enumValues.get(i);
editor.add(enumValue);
if (setValues.contains(enumValue)) {
selIndices[selIndex++] = i;
}
}
editor.select(selIndices);
}
}
}
\ No newline at end of file
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.data;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn;
import org.jkiss.dbeaver.model.data.DBDValue;
import org.jkiss.utils.CommonUtils;
/**
* Enum type
*/
public class MSSQLTypeEnum implements DBDValue {
private MSSQLTableColumn column;
private String value;
public MSSQLTypeEnum(MSSQLTypeEnum source)
{
this.column = source.column;
this.value = source.value;
}
public MSSQLTypeEnum(MSSQLTableColumn column, String value)
{
this.column = column;
this.value = value;
}
public MSSQLTableColumn getColumn()
{
return column;
}
public String getValue()
{
return value;
}
@Override
public boolean isNull()
{
return value == null;
}
@Override
public void release()
{
// do nothing
}
@Override
public int hashCode()
{
return value == null ? super.hashCode() : value.hashCode();
}
@Override
public boolean equals(Object obj)
{
return this == obj ||
(obj instanceof MSSQLTypeEnum && CommonUtils.equalObjects(((MSSQLTypeEnum)obj).getValue(), value));
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.data;
import org.eclipse.swt.graphics.Image;
import org.jkiss.dbeaver.ext.mssql.MSSQLConstants;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.data.DBDPreferences;
import org.jkiss.dbeaver.model.data.DBDValueHandler;
import org.jkiss.dbeaver.model.data.DBDValueHandlerProvider;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import java.sql.Types;
/**
* MSSQL data types provider
*/
public class MSSQLValueHandlerProvider implements DBDValueHandlerProvider {
@Override
public Image getTypeImage(DBSTypedObject type)
{
return DBUtils.getDataIcon(type).getImage();
}
@Override
public DBDValueHandler getHandler(DBDPreferences preferences, String typeName, int valueType)
{
if (MSSQLConstants.TYPE_NAME_ENUM.equalsIgnoreCase(typeName)) {
return MSSQLEnumValueHandler.INSTANCE;
} else if (MSSQLConstants.TYPE_NAME_SET.equalsIgnoreCase(typeName)) {
return MSSQLSetValueHandler.INSTANCE;
} else if (valueType == Types.DATE || valueType == Types.TIME || valueType == Types.TIMESTAMP) {
return new MSSQLDateTimeValueHandler(preferences.getDataFormatterProfile());
} else {
return null;
}
}
}
\ No newline at end of file
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import org.jkiss.dbeaver.ext.mssql.MSSQLMessages;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLDataSource;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.edit.DBEObjectRenamer;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.edit.AbstractDatabasePersistAction;
import org.jkiss.dbeaver.model.impl.jdbc.edit.struct.JDBCObjectEditor;
import org.jkiss.dbeaver.ui.dialogs.EnterNameDialog;
import org.jkiss.utils.CommonUtils;
/**
* MSSQLCatalogManager
*/
public class MSSQLCatalogManager extends JDBCObjectEditor<MSSQLCatalog, MSSQLDataSource> implements DBEObjectRenamer<MSSQLCatalog> {
@Override
public long getMakerOptions()
{
return FEATURE_SAVE_IMMEDIATELY;
}
@Override
public DBSObjectCache<MSSQLDataSource, MSSQLCatalog> getObjectsCache(MSSQLCatalog object)
{
return object.getDataSource().getCatalogCache();
}
@Override
protected MSSQLCatalog createDatabaseObject(IWorkbenchWindow workbenchWindow, DBECommandContext context, MSSQLDataSource parent, Object copyFrom)
{
String schemaName = EnterNameDialog.chooseName(workbenchWindow.getShell(), MSSQLMessages.edit_catalog_manager_dialog_schema_name);
if (CommonUtils.isEmpty(schemaName)) {
return null;
}
MSSQLCatalog newCatalog = new MSSQLCatalog(parent, null);
newCatalog.setName(schemaName);
return newCatalog;
}
@Override
protected IDatabasePersistAction[] makeObjectCreateActions(ObjectCreateCommand command)
{
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction("Create schema", "CREATE SCHEMA `" + command.getObject().getName() + "`") //$NON-NLS-2$
};
}
@Override
protected IDatabasePersistAction[] makeObjectDeleteActions(ObjectDeleteCommand command)
{
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction("Drop schema", "DROP SCHEMA `" + command.getObject().getName() + "`") //$NON-NLS-2$
};
}
@Override
public void renameObject(DBECommandContext commandContext, MSSQLCatalog catalog, String newName) throws DBException
{
throw new DBException("Direct database rename is not yet implemented in MSSQL. You should use export/import functions for that.");
//super.addCommand(new CommandRenameCatalog(newName), null);
//saveChanges(monitor);
}
/*
private class CommandRenameCatalog extends DBECommandAbstract<MSSQLCatalog> {
private String newName;
protected CommandRenameCatalog(MSSQLCatalog catalog, String newName)
{
super(catalog, "Rename catalog");
this.newName = newName;
}
public IDatabasePersistAction[] getPersistActions()
{
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction("Rename catalog", "RENAME SCHEMA " + getObject().getName() + " TO " + newName)
};
}
@Override
public void updateModel()
{
getObject().setName(newName);
getObject().getDataSource().getContainer().fireEvent(
new DBPEvent(DBPEvent.Action.OBJECT_UPDATE, getObject()));
}
}
*/
/*
http://www.artfulsoftware.com/infotree/queries.php#112
Rename Database
It's sometimes necessary to rename a database. MSSQL 5.0 has no command for it. Simply bringing down the server to rename a database directory is not safe. MSSQL 5.1.7 introduced a RENAME DATABASE command, but the command left several unchanged database objects behind, and was found to lose data, so it was dropped in 5.1.23.
It seems a natural for a stored procedure using dynamic (prepared) statements. PREPARE supports CREATE | RENAME TABLE. As precautions:
Before calling the sproc, the new database must have been created.
The procedure refuses to rename the mssql database.
The old database is left behind, minus what was moved.
DROP PROCEDURE IF EXISTS RenameDatabase;
DELIMITER go
CREATE PROCEDURE RenameDatabase( oldname CHAR (64), newname CHAR(64) )
BEGIN
DECLARE version CHAR(32);
DECLARE sname CHAR(64) DEFAULT NULL;
DECLARE rows INT DEFAULT 1;
DECLARE changed INT DEFAULT 0;
IF STRCMP( oldname, 'mssql' ) <> 0 THEN
REPEAT
SELECT table_name INTO sname
FROM information_schema.tables AS t
WHERE t.table_type='BASE TABLE' AND t.table_schema = oldname
LIMIT 1;
SET rows = FOUND_ROWS();
IF rows = 1 THEN
SET @scmd = CONCAT( 'RENAME TABLE `', oldname, '`.`', sname,
'` TO `', newname, '`.`', sname, '`' );
PREPARE cmd FROM @scmd;
EXECUTE cmd;
DEALLOCATE PREPARE cmd;
SET changed = 1;
END IF;
UNTIL rows = 0 END REPEAT;
IF changed > 0 THEN
SET @scmd = CONCAT( "UPDATE mssql.db SET Db = '",
newname,
"' WHERE Db = '", oldname, "'" );
PREPARE cmd FROM @scmd;
EXECUTE cmd;
DROP PREPARE cmd;
SET @scmd = CONCAT( "UPDATE mssql.proc SET Db = '",
newname,
"' WHERE Db = '", oldname, "'" );
PREPARE cmd FROM @scmd;
EXECUTE cmd;
DROP PREPARE cmd;
SELECT version() INTO version;
IF version >= '5.1.7' THEN
SET @scmd = CONCAT( "UPDATE mssql.event SET db = '",
newname,
"' WHERE db = '", oldname, "'" );
PREPARE cmd FROM @scmd;
EXECUTE cmd;
DROP PREPARE cmd;
END IF;
SET @scmd = CONCAT( "UPDATE mssql.columns_priv SET Db = '",
newname,
"' WHERE Db = '", oldname, "'" );
PREPARE cmd FROM @scmd;
EXECUTE cmd;
DROP PREPARE cmd;
FLUSH PRIVILEGES;
END IF;
END IF;
END;
go
DELIMITER ;
*/
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import org.jkiss.dbeaver.ext.mssql.MSSQLMessages;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLUser;
import org.jkiss.dbeaver.model.SQLUtils;
import org.jkiss.dbeaver.model.edit.prop.DBECommandComposite;
import org.jkiss.dbeaver.model.impl.edit.AbstractDatabasePersistAction;
import org.jkiss.utils.CommonUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Grant/Revoke privilege command
*/
public class MSSQLCommandChangeUser extends DBECommandComposite<MSSQLUser, UserPropertyHandler> {
protected MSSQLCommandChangeUser(MSSQLUser user)
{
super(user, MSSQLMessages.edit_command_change_user_name);
}
@Override
public void updateModel()
{
for (Map.Entry<Object, Object> entry : getProperties().entrySet()) {
switch (UserPropertyHandler.valueOf((String) entry.getKey())) {
case MAX_QUERIES: getObject().setMaxQuestions(CommonUtils.toInt(entry.getValue())); break;
case MAX_UPDATES: getObject().setMaxUpdates(CommonUtils.toInt(entry.getValue())); break;
case MAX_CONNECTIONS: getObject().setMaxConnections(CommonUtils.toInt(entry.getValue())); break;
case MAX_USER_CONNECTIONS: getObject().setMaxUserConnections(CommonUtils.toInt(entry.getValue())); break;
default:
break;
}
}
}
@Override
public void validateCommand() throws DBException
{
String passValue = CommonUtils.toString(getProperty(UserPropertyHandler.PASSWORD));
String confirmValue = CommonUtils.toString(getProperty(UserPropertyHandler.PASSWORD_CONFIRM));
if (!CommonUtils.isEmpty(passValue) && !CommonUtils.equalObjects(passValue, confirmValue)) {
throw new DBException("Password confirmation value is invalid");
}
}
@Override
public IDatabasePersistAction[] getPersistActions()
{
List<IDatabasePersistAction> actions = new ArrayList<IDatabasePersistAction>();
boolean newUser = !getObject().isPersisted();
if (newUser) {
actions.add(
new AbstractDatabasePersistAction(MSSQLMessages.edit_command_change_user_action_create_new_user, "CREATE USER " + getObject().getFullName()) { //$NON-NLS-2$
@Override
public void handleExecute(Throwable error)
{
if (error == null) {
getObject().setPersisted(true);
}
}
});
}
StringBuilder script = new StringBuilder();
script.append("UPDATE mssql.user SET "); //$NON-NLS-1$
boolean hasSet = false;
for (Map.Entry<Object, Object> entry : getProperties().entrySet()) {
if (entry.getKey() == UserPropertyHandler.PASSWORD_CONFIRM) {
continue;
}
String delim = hasSet ? "," : ""; //$NON-NLS-1$ //$NON-NLS-2$
switch (UserPropertyHandler.valueOf((String) entry.getKey())) {
case PASSWORD: script.append(delim).append("Password=PASSWORD('").append(SQLUtils.escapeString(CommonUtils.toString(entry.getValue()))).append("')"); hasSet = true; break; //$NON-NLS-1$ //$NON-NLS-2$
case MAX_QUERIES: script.append(delim).append("Max_Questions=").append(CommonUtils.toInt(entry.getValue())); hasSet = true; break; //$NON-NLS-1$
case MAX_UPDATES: script.append(delim).append("Max_Updates=").append(CommonUtils.toInt(entry.getValue())); hasSet = true; break; //$NON-NLS-1$
case MAX_CONNECTIONS: script.append(delim).append("Max_Connections=").append(CommonUtils.toInt(entry.getValue())); hasSet = true; break; //$NON-NLS-1$
case MAX_USER_CONNECTIONS: script.append(delim).append("Max_User_Connections=").append(CommonUtils.toInt(entry.getValue())); hasSet = true; break; //$NON-NLS-1$
default: break;
}
}
script.append(" WHERE User='").append(getObject().getUserName()).append("' AND Host='").append(getObject().getHost()).append("'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (hasSet) {
actions.add(new AbstractDatabasePersistAction(MSSQLMessages.edit_command_change_user_action_update_user_record, script.toString()));
}
return actions.toArray(new IDatabasePersistAction[actions.size()]);
}
}
\ No newline at end of file
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import org.jkiss.dbeaver.ext.mssql.MSSQLMessages;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLPrivilege;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTableBase;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLUser;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.edit.DBECommand;
import org.jkiss.dbeaver.model.impl.edit.AbstractDatabasePersistAction;
import org.jkiss.dbeaver.model.impl.edit.DBECommandAbstract;
import java.util.Map;
/**
* Grant/Revoke privilege command
*/
public class MSSQLCommandGrantPrivilege extends DBECommandAbstract<MSSQLUser> {
private boolean grant;
private MSSQLCatalog schema;
private MSSQLTableBase table;
private MSSQLPrivilege privilege;
public MSSQLCommandGrantPrivilege(MSSQLUser user, boolean grant, MSSQLCatalog schema, MSSQLTableBase table, MSSQLPrivilege privilege)
{
super(user, grant ? MSSQLMessages.edit_command_grant_privilege_action_grant_privilege : MSSQLMessages.edit_command_grant_privilege_name_revoke_privilege);
this.grant = grant;
this.schema = schema;
this.table = table;
this.privilege = privilege;
}
@Override
public void updateModel()
{
getObject().clearGrantsCache();
}
@Override
public IDatabasePersistAction[] getPersistActions()
{
String privName = privilege.getName();
String grantScript = "GRANT " + privName + //$NON-NLS-1$
" ON " + getObjectName() + //$NON-NLS-1$
" TO " + getObject().getFullName() + ""; //$NON-NLS-1$ //$NON-NLS-2$
String revokeScript = "REVOKE " + privName + //$NON-NLS-1$
" ON " + getObjectName() + //$NON-NLS-1$
" FROM " + getObject().getFullName() + ""; //$NON-NLS-1$ //$NON-NLS-2$
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction(
MSSQLMessages.edit_command_grant_privilege_action_grant_privilege,
grant ? grantScript : revokeScript)
};
}
@Override
public DBECommand<?> merge(DBECommand<?> prevCommand, Map<Object, Object> userParams)
{
if (prevCommand instanceof MSSQLCommandGrantPrivilege) {
MSSQLCommandGrantPrivilege prevGrant = (MSSQLCommandGrantPrivilege)prevCommand;
if (prevGrant.schema == schema && prevGrant.table == table && prevGrant.privilege == privilege) {
if (prevGrant.grant == grant) {
return prevCommand;
} else {
return null;
}
}
}
return super.merge(prevCommand, userParams);
}
private String getObjectName()
{
return
(schema == null ? "*" : DBUtils.getQuotedIdentifier(schema)) + "." + //$NON-NLS-1$ //$NON-NLS-2$
(table == null ? "*" : DBUtils.getQuotedIdentifier(table)); //$NON-NLS-1$
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.ext.mssql.MSSQLMessages;
import org.jkiss.dbeaver.ext.mssql.model.*;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.impl.DBObjectNameCaseTransformer;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.jdbc.edit.struct.JDBCConstraintManager;
import org.jkiss.dbeaver.model.struct.DBSEntityAttribute;
import org.jkiss.dbeaver.model.struct.DBSEntityConstraintType;
import org.jkiss.dbeaver.ui.dialogs.struct.EditConstraintDialog;
import org.jkiss.utils.CommonUtils;
/**
* MSSQL constraint manager
*/
public class MSSQLConstraintManager extends JDBCConstraintManager<MSSQLTableConstraint, MSSQLTable> {
@Override
public DBSObjectCache<MSSQLCatalog, MSSQLTableConstraint> getObjectsCache(MSSQLTableConstraint object)
{
return object.getTable().getContainer().getConstraintCache();
}
@Override
protected MSSQLTableConstraint createDatabaseObject(
IWorkbenchWindow workbenchWindow,
DBECommandContext context, MSSQLTable parent,
Object from)
{
EditConstraintDialog editDialog = new EditConstraintDialog(
workbenchWindow.getShell(),
MSSQLMessages.edit_constraint_manager_title,
parent,
new DBSEntityConstraintType[] {
DBSEntityConstraintType.PRIMARY_KEY,
DBSEntityConstraintType.UNIQUE_KEY });
if (editDialog.open() != IDialogConstants.OK_ID) {
return null;
}
final MSSQLTableConstraint constraint = new MSSQLTableConstraint(
parent,
null,
null,
editDialog.getConstraintType(),
false);
constraint.setName(DBObjectNameCaseTransformer.transformName(constraint, CommonUtils.escapeIdentifier(parent.getName()) + "_PK")); //$NON-NLS-1$
int colIndex = 1;
for (DBSEntityAttribute tableColumn : editDialog.getSelectedColumns()) {
constraint.addColumn(
new MSSQLTableConstraintColumn(
constraint,
(MSSQLTableColumn) tableColumn,
colIndex++));
}
return constraint;
}
@Override
protected String getDropConstraintPattern(MSSQLTableConstraint constraint)
{
String clause;
if (constraint.getConstraintType() == DBSEntityConstraintType.PRIMARY_KEY) {
clause = "PRIMARY KEY"; //$NON-NLS-1$
} else {
clause = "KEY"; //$NON-NLS-1$
}
return "ALTER TABLE " + PATTERN_ITEM_TABLE +" DROP " + clause + " " + PATTERN_ITEM_CONSTRAINT; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.ext.mssql.MSSQLMessages;
import org.jkiss.dbeaver.ext.mssql.model.*;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.impl.DBObjectNameCaseTransformer;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.jdbc.edit.struct.JDBCForeignKeyManager;
import org.jkiss.dbeaver.model.struct.DBSObject;
import org.jkiss.dbeaver.model.struct.rdb.DBSForeignKeyModifyRule;
import org.jkiss.dbeaver.ui.dialogs.struct.EditForeignKeyDialog;
import org.jkiss.utils.CommonUtils;
/**
* MSSQL foreign key manager
*/
public class MSSQLForeignKeyManager extends JDBCForeignKeyManager<MSSQLTableForeignKey, MSSQLTable> {
@Override
public DBSObjectCache<? extends DBSObject, MSSQLTableForeignKey> getObjectsCache(MSSQLTableForeignKey object)
{
return object.getParentObject().getForeignKeyCache();
}
@Override
protected MSSQLTableForeignKey createDatabaseObject(IWorkbenchWindow workbenchWindow, DBECommandContext context, MSSQLTable table, Object from)
{
EditForeignKeyDialog editDialog = new EditForeignKeyDialog(
workbenchWindow.getShell(),
MSSQLMessages.edit_foreign_key_manager_title,
table,
new DBSForeignKeyModifyRule[] {
DBSForeignKeyModifyRule.NO_ACTION,
DBSForeignKeyModifyRule.CASCADE, DBSForeignKeyModifyRule.RESTRICT,
DBSForeignKeyModifyRule.SET_NULL,
DBSForeignKeyModifyRule.SET_DEFAULT });
if (editDialog.open() != IDialogConstants.OK_ID) {
return null;
}
final MSSQLTableForeignKey foreignKey = new MSSQLTableForeignKey(
table,
null,
null,
(MSSQLTableConstraint) editDialog.getUniqueConstraint(),
editDialog.getOnDeleteRule(),
editDialog.getOnUpdateRule(),
false);
foreignKey.setName(DBObjectNameCaseTransformer.transformName(foreignKey,
CommonUtils.escapeIdentifier(table.getName()) + "_" + //$NON-NLS-1$
CommonUtils.escapeIdentifier(editDialog.getUniqueConstraint().getParentObject().getName()) + "_FK")); //$NON-NLS-1$
int colIndex = 1;
for (EditForeignKeyDialog.FKColumnInfo tableColumn : editDialog.getColumns()) {
foreignKey.addColumn(
new MSSQLTableForeignKeyColumnTable(
foreignKey,
(MSSQLTableColumn) tableColumn.getOwnColumn(),
colIndex++,
(MSSQLTableColumn) tableColumn.getRefColumn()));
}
return foreignKey;
}
@Override
protected String getDropForeignKeyPattern(MSSQLTableForeignKey foreignKey)
{
return "ALTER TABLE " + PATTERN_ITEM_TABLE + " DROP FOREIGN KEY " + PATTERN_ITEM_CONSTRAINT; //$NON-NLS-1$ //$NON-NLS-2$
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.ext.mssql.MSSQLMessages;
import org.jkiss.dbeaver.ext.mssql.model.*;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.impl.DBObjectNameCaseTransformer;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.jdbc.edit.struct.JDBCIndexManager;
import org.jkiss.dbeaver.model.struct.DBSEntityAttribute;
import org.jkiss.dbeaver.model.struct.rdb.DBSIndexType;
import org.jkiss.dbeaver.ui.dialogs.struct.EditIndexDialog;
import org.jkiss.utils.CommonUtils;
import java.util.Collections;
/**
* MSSQL index manager
*/
public class MSSQLIndexManager extends JDBCIndexManager<MSSQLTableIndex, MSSQLTable> {
@Override
public DBSObjectCache<MSSQLCatalog, MSSQLTableIndex> getObjectsCache(MSSQLTableIndex object)
{
return object.getTable().getContainer().getIndexCache();
}
@Override
protected MSSQLTableIndex createDatabaseObject(
IWorkbenchWindow workbenchWindow,
DBECommandContext context, MSSQLTable parent,
Object from)
{
EditIndexDialog editDialog = new EditIndexDialog(
workbenchWindow.getShell(),
MSSQLMessages.edit_index_manager_title,
parent,
Collections.singletonList(DBSIndexType.OTHER));
if (editDialog.open() != IDialogConstants.OK_ID) {
return null;
}
final MSSQLTableIndex index = new MSSQLTableIndex(
parent,
false,
null,
editDialog.getIndexType(),
null);
StringBuilder idxName = new StringBuilder(64);
idxName.append(CommonUtils.escapeIdentifier(parent.getName()));
int colIndex = 1;
for (DBSEntityAttribute tableColumn : editDialog.getSelectedColumns()) {
if (colIndex == 1) {
idxName.append("_").append(CommonUtils.escapeIdentifier(tableColumn.getName())); //$NON-NLS-1$
}
index.addColumn(
new MSSQLTableIndexColumn(
index,
(MSSQLTableColumn) tableColumn,
colIndex++,
true,
false));
}
idxName.append("_IDX"); //$NON-NLS-1$
index.setName(DBObjectNameCaseTransformer.transformName(index, idxName.toString()));
return index;
}
@Override
protected String getDropIndexPattern(MSSQLTableIndex index)
{
return "ALTER TABLE " + PATTERN_ITEM_TABLE + " DROP INDEX " + PATTERN_ITEM_INDEX_SHORT; //$NON-NLS-1$ //$NON-NLS-2$
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLProcedure;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.edit.AbstractDatabasePersistAction;
import org.jkiss.dbeaver.model.impl.jdbc.edit.struct.JDBCObjectEditor;
import org.jkiss.dbeaver.ui.dialogs.struct.CreateProcedureDialog;
import org.jkiss.utils.CommonUtils;
/**
* MSSQLProcedureManager
*/
public class MSSQLProcedureManager extends JDBCObjectEditor<MSSQLProcedure, MSSQLCatalog> {
@Override
public DBSObjectCache<MSSQLCatalog, MSSQLProcedure> getObjectsCache(MSSQLProcedure object)
{
return object.getContainer().getProceduresCache();
}
@Override
public long getMakerOptions()
{
return FEATURE_EDITOR_ON_CREATE;
}
@Override
protected void validateObjectProperties(ObjectChangeCommand command)
throws DBException
{
if (CommonUtils.isEmpty(command.getObject().getName())) {
throw new DBException("Procedure name cannot be empty");
}
if (CommonUtils.isEmpty(command.getObject().getBody())) {
throw new DBException("Procedure body cannot be empty");
}
}
@Override
protected MSSQLProcedure createDatabaseObject(IWorkbenchWindow workbenchWindow, DBECommandContext context, MSSQLCatalog parent, Object copyFrom)
{
CreateProcedureDialog dialog = new CreateProcedureDialog(workbenchWindow.getShell(), parent.getDataSource());
if (dialog.open() != IDialogConstants.OK_ID) {
return null;
}
MSSQLProcedure newProcedure = new MSSQLProcedure(parent);
newProcedure.setProcedureType(dialog.getProcedureType());
newProcedure.setName(dialog.getProcedureName());
return newProcedure;
}
@Override
protected IDatabasePersistAction[] makeObjectCreateActions(ObjectCreateCommand command)
{
return createOrReplaceProcedureQuery(command.getObject());
}
@Override
protected IDatabasePersistAction[] makeObjectModifyActions(ObjectChangeCommand command)
{
return createOrReplaceProcedureQuery(command.getObject());
}
@Override
protected IDatabasePersistAction[] makeObjectDeleteActions(ObjectDeleteCommand command)
{
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction("Drop procedure", "DROP PROCEDURE " + command.getObject().getFullQualifiedName()) //$NON-NLS-2$
};
}
private IDatabasePersistAction[] createOrReplaceProcedureQuery(MSSQLProcedure procedure)
{
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction("Drop procedure", "DROP " + procedure.getProcedureType() + " IF EXISTS " + procedure.getFullQualifiedName()), //$NON-NLS-2$ //$NON-NLS-3$
new AbstractDatabasePersistAction("Create procedure", "CREATE " + procedure.getClientBody()) //$NON-NLS-2$
};
}
/*
public ITabDescriptor[] getTabDescriptors(IWorkbenchWindow workbenchWindow, final IDatabaseEditor activeEditor, final MSSQLProcedure object)
{
if (object.getContainer().isSystem()) {
return null;
}
return new ITabDescriptor[] {
new PropertyTabDescriptor(
PropertiesContributor.CATEGORY_INFO,
"procedure.body", //$NON-NLS-1$
MSSQLMessages.edit_procedure_manager_body,
DBIcon.SOURCES.getImage(),
new SectionDescriptor("default", MSSQLMessages.edit_procedure_manager_body) {
public ISection getSectionClass()
{
return new MSSQLProcedureBodySection(activeEditor);
}
})
};
}
*/
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTableBase;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTableColumn;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.edit.prop.DBECommandComposite;
import org.jkiss.dbeaver.model.impl.DBObjectNameCaseTransformer;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.edit.AbstractDatabasePersistAction;
import org.jkiss.dbeaver.model.impl.jdbc.edit.struct.JDBCTableColumnManager;
import org.jkiss.dbeaver.model.struct.DBSDataKind;
import org.jkiss.dbeaver.model.struct.DBSDataType;
import org.jkiss.dbeaver.model.struct.DBSObject;
import org.jkiss.utils.CommonUtils;
import java.sql.Types;
/**
* MSSQL table column manager
*/
public class MSSQLTableColumnManager extends JDBCTableColumnManager<MSSQLTableColumn, MSSQLTableBase> {
@Override
public DBSObjectCache<? extends DBSObject, MSSQLTableColumn> getObjectsCache(MSSQLTableColumn object)
{
return object.getParentObject().getContainer().getTableCache().getChildrenCache(object.getParentObject());
}
@Override
public StringBuilder getNestedDeclaration(MSSQLTableBase owner, DBECommandComposite<MSSQLTableColumn, PropertyHandler> command)
{
StringBuilder decl = super.getNestedDeclaration(owner, command);
final MSSQLTableColumn column = command.getObject();
if (column.isSequence()) {
decl.append(" AUTO_INCREMENT"); //$NON-NLS-1$
}
if (!CommonUtils.isEmpty(column.getComment())) {
decl.append(" COMMENT '").append(column.getComment()).append("'"); //$NON-NLS-1$ //$NON-NLS-2$
}
return decl;
}
@Override
protected MSSQLTableColumn createDatabaseObject(IWorkbenchWindow workbenchWindow, DBECommandContext context, MSSQLTableBase parent, Object copyFrom)
{
DBSDataType columnType = findBestDataType(parent.getDataSource(), "varchar"); //$NON-NLS-1$
final MSSQLTableColumn column = new MSSQLTableColumn(parent);
column.setName(DBObjectNameCaseTransformer.transformName(column, getNewColumnName(context, parent)));
column.setTypeName(columnType == null ? "INTEGER" : columnType.getName()); //$NON-NLS-1$
column.setMaxLength(columnType != null && columnType.getDataKind() == DBSDataKind.STRING ? 100 : 0);
column.setValueType(columnType == null ? Types.INTEGER : columnType.getTypeID());
column.setOrdinalPosition(-1);
return column;
}
@Override
protected IDatabasePersistAction[] makeObjectModifyActions(ObjectChangeCommand command)
{
final MSSQLTableColumn column = command.getObject();
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction(
"Modify column",
"ALTER TABLE " + column.getTable().getFullQualifiedName() + " MODIFY COLUMN " + getNestedDeclaration(column.getTable(), command))}; //$NON-NLS-1$ //$NON-NLS-2$
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import org.jkiss.dbeaver.ext.mssql.model.*;
import org.jkiss.dbeaver.model.DBConstants;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.edit.DBEObjectRenamer;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.impl.DBObjectNameCaseTransformer;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.edit.AbstractDatabasePersistAction;
import org.jkiss.dbeaver.model.impl.jdbc.edit.struct.JDBCTableManager;
import org.jkiss.dbeaver.runtime.VoidProgressMonitor;
/**
* MSSQL table manager
*/
public class MSSQLTableManager extends JDBCTableManager<MSSQLTableBase, MSSQLCatalog> implements DBEObjectRenamer<MSSQLTableBase> {
private static final Class<?>[] CHILD_TYPES = {
MSSQLTableColumn.class,
MSSQLTableConstraint.class,
MSSQLTableForeignKey.class,
MSSQLTableIndex.class
};
@Override
public DBSObjectCache<MSSQLCatalog, MSSQLTableBase> getObjectsCache(MSSQLTableBase object)
{
return object.getContainer().getTableCache();
}
@Override
protected MSSQLTable createDatabaseObject(IWorkbenchWindow workbenchWindow, DBECommandContext context, MSSQLCatalog parent, Object copyFrom)
{
final MSSQLTable table = new MSSQLTable(parent);
table.setName(DBObjectNameCaseTransformer.transformName(parent, "NewTable")); //$NON-NLS-1$
try {
final MSSQLTable.AdditionalInfo additionalInfo = table.getAdditionalInfo(VoidProgressMonitor.INSTANCE);
additionalInfo.setEngine(parent.getDataSource().getDefaultEngine());
additionalInfo.setCharset(parent.getDefaultCharset());
additionalInfo.setCollation(parent.getDefaultCollation());
} catch (DBCException e) {
// Never be here
log.error(e);
}
return table;
}
@Override
protected IDatabasePersistAction[] makeObjectModifyActions(ObjectChangeCommand command)
{
StringBuilder query = new StringBuilder("ALTER TABLE "); //$NON-NLS-1$
query.append(command.getObject().getFullQualifiedName()).append(" "); //$NON-NLS-1$
appendTableModifiers(command.getObject(), command, query);
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction(query.toString())
};
}
@Override
protected void appendTableModifiers(MSSQLTableBase tableBase, NestedObjectCommand tableProps, StringBuilder ddl)
{
if (tableBase instanceof MSSQLTable) {
MSSQLTable table =(MSSQLTable)tableBase;
try {
final MSSQLTable.AdditionalInfo additionalInfo = table.getAdditionalInfo(VoidProgressMonitor.INSTANCE);
if ((!table.isPersisted() || tableProps.getProperty("engine") != null) && additionalInfo.getEngine() != null) { //$NON-NLS-1$
ddl.append("\nENGINE=").append(additionalInfo.getEngine().getName()); //$NON-NLS-1$
}
if ((!table.isPersisted() || tableProps.getProperty("charset") != null) && additionalInfo.getCharset() != null) { //$NON-NLS-1$
ddl.append("\nDEFAULT CHARSET=").append(additionalInfo.getCharset().getName()); //$NON-NLS-1$
}
if ((!table.isPersisted() || tableProps.getProperty("collation") != null) && additionalInfo.getCollation() != null) { //$NON-NLS-1$
ddl.append("\nCOLLATE=").append(additionalInfo.getCollation().getName()); //$NON-NLS-1$
}
if ((!table.isPersisted() || tableProps.getProperty(DBConstants.PROP_ID_DESCRIPTION) != null) && table.getDescription() != null) {
ddl.append("\nCOMMENT='").append(table.getDescription().replace('\'', '"')).append("'"); //$NON-NLS-1$ //$NON-NLS-2$
}
if ((!table.isPersisted() || tableProps.getProperty("autoIncrement") != null) && additionalInfo.getAutoIncrement() > 0) { //$NON-NLS-1$
ddl.append("\nAUTO_INCREMENT=").append(additionalInfo.getAutoIncrement()); //$NON-NLS-1$
}
} catch (DBCException e) {
log.error(e);
}
}
}
@Override
protected IDatabasePersistAction[] makeObjectRenameActions(ObjectRenameCommand command)
{
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction(
"Rename table",
"RENAME TABLE " + command.getObject().getFullQualifiedName() + //$NON-NLS-1$
" TO " + DBUtils.getQuotedIdentifier(command.getObject().getDataSource(), command.getNewName())) //$NON-NLS-1$
};
}
@Override
public Class<?>[] getChildTypes()
{
return CHILD_TYPES;
}
@Override
public void renameObject(DBECommandContext commandContext, MSSQLTableBase object, String newName) throws DBException
{
processObjectRename(commandContext, object, newName);
}
/*
public ITabDescriptor[] getTabDescriptors(IWorkbenchWindow workbenchWindow, final IDatabaseEditor activeEditor, final MSSQLTable object)
{
if (object.getContainer().isSystem()) {
return null;
}
return new ITabDescriptor[] {
new PropertyTabDescriptor(
PropertiesContributor.CATEGORY_INFO,
"table.ddl", //$NON-NLS-1$
"DDL", //$NON-NLS-1$
DBIcon.SOURCES.getImage(),
new SectionDescriptor("default", "DDL") { //$NON-NLS-1$ //$NON-NLS-2$
public ISection getSectionClass()
{
return new MSSQLDDLViewEditor(activeEditor);
}
})
};
}
*/
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTrigger;
import org.jkiss.dbeaver.model.impl.jdbc.edit.JDBCObjectManager;
/**
* MSSQLTriggerManager
*/
public class MSSQLTriggerManager extends JDBCObjectManager<MSSQLTrigger> {
/*
@Override
protected JDBCAbstractCache<MSSQLCatalog, MSSQLTrigger> getObjectsCache(MSSQLTrigger object)
{
return object.getContainer().getProceduresCache();
}
*/
/*
public ITabDescriptor[] getTabDescriptors(IWorkbenchWindow workbenchWindow, final IDatabaseEditor activeEditor, final MSSQLTrigger object)
{
return new ITabDescriptor[] {
new PropertyTabDescriptor(
PropertiesContributor.CATEGORY_INFO,
"trigger.body",
MSSQLMessages.edit_procedure_manager_body,
DBIcon.SOURCES.getImage(),
new SectionDescriptor("default", MSSQLMessages.edit_procedure_manager_body) {
public ISection getSectionClass()
{
return new MSSQLTriggerBodySection(activeEditor);
}
})
};
}
*/
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import org.jkiss.dbeaver.ext.mssql.MSSQLMessages;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLDataSource;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLUser;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.edit.DBECommandFilter;
import org.jkiss.dbeaver.model.edit.DBECommandQueue;
import org.jkiss.dbeaver.model.edit.DBEObjectMaker;
import org.jkiss.dbeaver.model.edit.prop.DBECommandComposite;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.edit.AbstractDatabasePersistAction;
import org.jkiss.dbeaver.model.impl.edit.DBECommandAbstract;
import org.jkiss.dbeaver.model.impl.edit.DatabaseObjectScriptCommand;
import org.jkiss.dbeaver.model.impl.jdbc.edit.JDBCObjectManager;
import org.jkiss.dbeaver.model.struct.DBSObject;
import java.util.Map;
/**
* MSSQLUserManager
*/
public class MSSQLUserManager extends JDBCObjectManager<MSSQLUser> implements DBEObjectMaker<MSSQLUser, MSSQLDataSource>, DBECommandFilter<MSSQLUser> {
@Override
public long getMakerOptions()
{
return FEATURE_EDITOR_ON_CREATE;
}
@Override
public DBSObjectCache<? extends DBSObject, MSSQLUser> getObjectsCache(MSSQLUser object)
{
return null;
}
@Override
public MSSQLUser createNewObject(IWorkbenchWindow workbenchWindow, DBECommandContext commandContext, MSSQLDataSource parent, Object copyFrom)
{
MSSQLUser newUser = new MSSQLUser(parent, null);
if (copyFrom instanceof MSSQLUser) {
MSSQLUser tplUser = (MSSQLUser)copyFrom;
newUser.setUserName(tplUser.getUserName());
newUser.setHost(tplUser.getHost());
newUser.setMaxQuestions(tplUser.getMaxQuestions());
newUser.setMaxUpdates(tplUser.getMaxUpdates());
newUser.setMaxConnections(tplUser.getMaxConnections());
newUser.setMaxUserConnections(tplUser.getMaxUserConnections());
}
commandContext.addCommand(new CommandCreateUser(newUser), new CreateObjectReflector<MSSQLUser>(this), true);
return newUser;
}
@Override
public void deleteObject(DBECommandContext commandContext, MSSQLUser user, Map<String, Object> options)
{
commandContext.addCommand(new CommandDropUser(user), new DeleteObjectReflector<MSSQLUser>(this), true);
}
@Override
public void filterCommands(DBECommandQueue<MSSQLUser> queue)
{
if (!queue.isEmpty()) {
// Add privileges flush to the tail
queue.add(
new DatabaseObjectScriptCommand<MSSQLUser>(
queue.getObject(),
MSSQLMessages.edit_user_manager_command_flush_privileges,
"FLUSH PRIVILEGES")); //$NON-NLS-1$
}
}
private static class CommandCreateUser extends DBECommandAbstract<MSSQLUser> {
protected CommandCreateUser(MSSQLUser user)
{
super(user, MSSQLMessages.edit_user_manager_command_create_user);
}
}
private static class CommandDropUser extends DBECommandComposite<MSSQLUser, UserPropertyHandler> {
protected CommandDropUser(MSSQLUser user)
{
super(user, MSSQLMessages.edit_user_manager_command_drop_user);
}
@Override
public IDatabasePersistAction[] getPersistActions()
{
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction(MSSQLMessages.edit_user_manager_command_drop_user, "DROP USER " + getObject().getFullName()) { //$NON-NLS-2$
@Override
public void handleExecute(Throwable error)
{
if (error == null) {
getObject().setPersisted(false);
}
}
}};
}
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLCatalog;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTableBase;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLView;
import org.jkiss.dbeaver.model.edit.DBECommandContext;
import org.jkiss.dbeaver.model.impl.DBSObjectCache;
import org.jkiss.dbeaver.model.impl.edit.AbstractDatabasePersistAction;
import org.jkiss.dbeaver.model.impl.jdbc.edit.struct.JDBCObjectEditor;
import org.jkiss.dbeaver.utils.ContentUtils;
import org.jkiss.utils.CommonUtils;
/**
* MSSQLViewManager
*/
public class MSSQLViewManager extends JDBCObjectEditor<MSSQLTableBase, MSSQLCatalog> {
@Override
public DBSObjectCache<MSSQLCatalog, MSSQLTableBase> getObjectsCache(MSSQLTableBase object)
{
return object.getContainer().getTableCache();
}
@Override
public long getMakerOptions()
{
return FEATURE_EDITOR_ON_CREATE;
}
@Override
protected void validateObjectProperties(ObjectChangeCommand command)
throws DBException
{
MSSQLTableBase object = command.getObject();
if (CommonUtils.isEmpty(object.getName())) {
throw new DBException("View name cannot be empty");
}
if (CommonUtils.isEmpty(((MSSQLView) object).getAdditionalInfo().getDefinition())) {
throw new DBException("View definition cannot be empty");
}
}
@Override
protected MSSQLView createDatabaseObject(IWorkbenchWindow workbenchWindow, DBECommandContext context, MSSQLCatalog parent, Object copyFrom)
{
MSSQLView newCatalog = new MSSQLView(parent);
newCatalog.setName("NewView"); //$NON-NLS-1$
return newCatalog;
}
@Override
protected IDatabasePersistAction[] makeObjectCreateActions(ObjectCreateCommand command)
{
return createOrReplaceViewQuery((MSSQLView) command.getObject());
}
@Override
protected IDatabasePersistAction[] makeObjectModifyActions(ObjectChangeCommand command)
{
return createOrReplaceViewQuery((MSSQLView) command.getObject());
}
@Override
protected IDatabasePersistAction[] makeObjectDeleteActions(ObjectDeleteCommand command)
{
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction("Drop view", "DROP VIEW " + command.getObject().getFullQualifiedName()) //$NON-NLS-2$
};
}
private IDatabasePersistAction[] createOrReplaceViewQuery(MSSQLView view)
{
StringBuilder decl = new StringBuilder(200);
final String lineSeparator = ContentUtils.getDefaultLineSeparator();
decl.append("CREATE OR REPLACE VIEW ").append(view.getFullQualifiedName()).append(lineSeparator) //$NON-NLS-1$
.append("AS ").append(view.getAdditionalInfo().getDefinition()); //$NON-NLS-1$
final MSSQLView.CheckOption checkOption = view.getAdditionalInfo().getCheckOption();
if (checkOption != null && checkOption != MSSQLView.CheckOption.NONE) {
decl.append(lineSeparator).append("WITH ").append(checkOption.getDefinitionName()).append(" CHECK OPTION"); //$NON-NLS-1$ //$NON-NLS-2$
}
return new IDatabasePersistAction[] {
new AbstractDatabasePersistAction("Create view", decl.toString())
};
}
/*
public ITabDescriptor[] getTabDescriptors(IWorkbenchWindow workbenchWindow, final IDatabaseEditor activeEditor, final MSSQLView object)
{
if (object.getContainer().isSystem()) {
return null;
}
return new ITabDescriptor[] {
new PropertyTabDescriptor(
PropertiesContributor.CATEGORY_INFO,
"view.definition", //$NON-NLS-1$
MSSQLMessages.edit_view_manager_definition,
DBIcon.SOURCES.getImage(),
new SectionDescriptor("default", MSSQLMessages.edit_view_manager_definition) { //$NON-NLS-1$
public ISection getSectionClass()
{
return new MSSQLViewDefinitionSection(activeEditor);
}
})
};
}
*/
}
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.edit;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLUser;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.edit.prop.DBEPropertyHandler;
import org.jkiss.dbeaver.model.edit.prop.DBEPropertyReflector;
import org.jkiss.utils.CommonUtils;
/**
* User property handler
*/
public enum UserPropertyHandler implements DBEPropertyHandler<MSSQLUser>, DBEPropertyReflector<MSSQLUser> {
NAME,
HOST,
PASSWORD,
PASSWORD_CONFIRM,
MAX_QUERIES,
MAX_UPDATES,
MAX_CONNECTIONS,
MAX_USER_CONNECTIONS;
@Override
public Object getId()
{
return name();
}
@Override
public MSSQLCommandChangeUser createCompositeCommand(MSSQLUser object)
{
return new MSSQLCommandChangeUser(object);
}
@Override
public void reflectValueChange(MSSQLUser object, Object oldValue, Object newValue)
{
if (this == NAME || this == HOST) {
if (this == NAME) {
object.setUserName(CommonUtils.toString(newValue));
} else {
object.setHost(CommonUtils.toString(newValue));
}
DBUtils.fireObjectUpdate(object);
}
}
}
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.editors;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLTable;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.ui.editors.sql.SQLEditorNested;
/**
* MSSQLDDLViewEditor
*/
public class MSSQLDDLViewEditor extends SQLEditorNested<MSSQLTable> {
@Override
protected boolean isReadOnly()
{
return true;
}
@Override
protected String getSourceText(DBRProgressMonitor monitor) throws DBException
{
return getSourceObject().getDDL(monitor);
}
@Override
protected void setSourceText(String sourceText)
{
}
}
\ No newline at end of file
/*
* Copyright (C) 2010-2013 Serge Rieder serge@jkiss.org
* Copyright (C) 2011-2012 Eugene Fradkin eugene.fradkin@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.editors;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.jkiss.dbeaver.ext.IDatabaseEditorInput;
import org.jkiss.dbeaver.ext.mssql.MSSQLMessages;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLDataSource;
import org.jkiss.dbeaver.ext.mssql.model.session.MSSQLSessionManager;
import org.jkiss.dbeaver.model.DBPDataSource;
import org.jkiss.dbeaver.model.admin.sessions.DBAServerSession;
import org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager;
import org.jkiss.dbeaver.ui.DBIcon;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.editors.SinglePageDatabaseEditor;
import org.jkiss.dbeaver.ui.views.session.SessionManagerViewer;
import org.jkiss.utils.CommonUtils;
import java.util.Collections;
/**
* MSSQLSessionEditor
*/
public class MSSQLSessionEditor extends SinglePageDatabaseEditor<IDatabaseEditorInput>
{
static final Log log = LogFactory.getLog(MSSQLSessionEditor.class);
private SessionManagerViewer sessionsViewer;
private KillSessionAction killSessionAction;
private KillSessionAction terminateQueryAction;
@Override
public void dispose()
{
sessionsViewer.dispose();
super.dispose();
}
@Override
public void createPartControl(Composite parent) {
killSessionAction = new KillSessionAction(false);
terminateQueryAction = new KillSessionAction(true);
sessionsViewer = new SessionManagerViewer(this, parent, new MSSQLSessionManager(getDataSource())) {
@Override
protected void contributeToToolbar(DBAServerSessionManager sessionManager, ToolBarManager toolBar)
{
toolBar.add(killSessionAction);
toolBar.add(terminateQueryAction);
toolBar.add(new Separator());
}
@Override
protected void onSessionSelect(DBAServerSession session)
{
super.onSessionSelect(session);
killSessionAction.setEnabled(session != null);
terminateQueryAction.setEnabled(session != null && !CommonUtils.isEmpty(session.getActiveQuery()));
}
};
sessionsViewer.refreshSessions();
}
@Override
public MSSQLDataSource getDataSource()
{
DBPDataSource dataSource = super.getDataSource();
if (dataSource instanceof MSSQLDataSource) {
return (MSSQLDataSource)dataSource;
}
log.error("Bad datasource object: " + dataSource); //$NON-NLS-1$
return null;
}
@Override
public void refreshPart(Object source, boolean force)
{
sessionsViewer.refreshSessions();
}
private class KillSessionAction extends Action {
private boolean killQuery;
public KillSessionAction(boolean killQuery)
{
super(
killQuery ? MSSQLMessages.editors_session_editor_action_terminate_Query : MSSQLMessages.editors_session_editor_action_kill_Session,
killQuery ?
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ELCL_STOP) :
DBIcon.SQL_DISCONNECT.getImageDescriptor());
this.killQuery = killQuery;
}
@Override
public void run()
{
final DBAServerSession session = sessionsViewer.getSelectedSession();
if (session != null && UIUtils.confirmAction(getSite().getShell(),
this.getText(),
NLS.bind(MSSQLMessages.editors_session_editor_confirm, getText(), session)))
{
sessionsViewer.alterSession(
sessionsViewer.getSelectedSession(),
Collections.singletonMap(MSSQLSessionManager.PROP_KILL_QUERY, (Object)killQuery));
}
}
}
}
\ No newline at end of file
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.editors;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mssql.model.MSSQLSourceObject;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.ui.editors.sql.SQLEditorNested;
/**
* MSSQLSourceViewEditor
*/
public class MSSQLSourceViewEditor extends SQLEditorNested<MSSQLSourceObject> {
public MSSQLSourceViewEditor()
{
}
@Override
protected boolean isReadOnly()
{
return false;
}
@Override
protected String getSourceText(DBRProgressMonitor monitor) throws DBException
{
return getSourceObject().getSourceText(monitor);
}
@Override
protected void setSourceText(String sourceText)
{
getEditorInput().getPropertySource().setPropertyValue("sourceText", sourceText);
}
}
\ No newline at end of file
/*
* Copyright (C) 2010-2013 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mssql.model;
import org.jkiss.dbeaver.ext.mssql.MSSQLConstants;
import org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils;
import org.jkiss.dbeaver.model.meta.Property;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
/**
* MSSQLCharset
*/
public class MSSQLCharset extends MSSQLInformation {
private String name;
private String description;
private int maxLength;
private List<MSSQLCollation> collations = new ArrayList<MSSQLCollation>();
public MSSQLCharset(MSSQLDataSource dataSource, ResultSet dbResult)
throws SQLException
{
super(dataSource);
this.loadInfo(dbResult);
}
private void loadInfo(ResultSet dbResult)
throws SQLException
{
this.name = JDBCUtils.safeGetString(dbResult, MSSQLConstants.COL_CHARSET);
this.description = JDBCUtils.safeGetString(dbResult, MSSQLConstants.COL_DESCRIPTION);
this.maxLength = JDBCUtils.safeGetInt(dbResult, MSSQLConstants.COL_MAX_LENGTH);
}
void addCollation(MSSQLCollation collation)
{
collations.add(collation);
}
@Override
@Property(viewable = true, order = 1)
public String getName()
{
return name;
}
public List<MSSQLCollation> getCollations()
{
return collations;
}
@Property(viewable = true, order = 2)
public MSSQLCollation getDefaultCollation()
{
for (MSSQLCollation collation : collations) {
if (collation.isDefault()) {
return collation;
}
}
return null;
}
@Property(viewable = true, order = 3)
public int getMaxLength()
{
return maxLength;
}
@Override
@Property(viewable = true, order = 100)
public String getDescription()
{
return description;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册