Dbj is a RDBMS query tool for JDBC-enabled databases.
It allows easy access to your Databases when you do not have a specific query
tool. Additional functionalities provide simple schema, table and data management.
Without a "dbj.properties" file, the "JDBC Drivers registration"
dialog will be the first one to show up (and will allow to automatically create
this "dbj.properties" file). You need at list one declared driver
to connect to a database (You can also add the required files to your system
classpath).
You can add a driver by selecting the jar file containing it. Dbj parses the
file and instantiates the classes that implement the Driver class. This allows
you to define the connections.
To add a new Connection, just select "Add" in the "Connection"
menu. You can either enter all required fields or copy from an existing connection
: select it then click on the small green button.
You can copy-paste one of the sample URLs that are provided.
The "View objects" field is required for meta-data information collection
: depending on the selected JDBC driver, the Views are declared differently
(usually "VIEW" or "V", but some RDBMS do not handle Views...).
If you do not know this information, just fill all fields but this one, then
click on the "Test" button. If your connection is correct, Dbj will
provide you the list of table types recognized by the driver. You can thus easily
fulfill this last field with the correct type.
You can see multiple sections in this frame. From top to down, the horizontal toolbar with Execution buttons and shortcuts, the script edit area, the result area, the status bar & options. On the left side, a vertical toolbar provides more tools.
The "Exec" button (Shortcut Alt-E) will execute the full content
of the Script edit area. Depending on the RDBMS, separation of multiple statements
can be done using the ";" separator. All rows starting by "//"
will be removed from the script (Comments).
The "Exec sel" button (Shortcut Alt-S) will execute only the selected
-highlighted- text.
The "Repeat" button (Shortcut Alt-R) will re-execute the last executed
statement, whatever is edited or selected.
Different combo boxes allow you to browse the different database objects - Schemas,
Tables, Views, Stored Procedures. When you select a Table or a View, the Columns
of this object will be displayed in the related combo box. By clicking the small
"insert" red triangle you will insert the table, column... name in
the edit area. The question marks are shortcuts to the Schema and Table tools.
Depending on which tab is selected, the execution will change :
The status bar provides quick reference to the current connection
and the last execution. When you just performed a query, a roll-over on
this status bar shows the "execution time" (the time taken to parse and
process the query on the server) and "fetch time" (the time taken to
retrieve all rows from server to dbj).
Depending on the JDBC Driver ability, you can either select an "Autocommit"
mode either have to click each time on "Commit" or "Rollback"
after executing a set of statements.
A small locker-like button allows you to define the "Isolation settings".
This will allow you to read committed or uncommitted transactions, or serialize
all transactions (Not all settings are available depending on your JDBC driver).
A "Rowcount" edit zone provides you the ability to limit the number
of returned rows. If you enter 0 in this zone, all rows will be returned.
The last option is an "Abort" button. Only available during long executions,
it allows you to abort the current execution. You should get back control when
aborting the execution, however the server-side execution may go on, depending
on the JDBC driver functionalities.
This toolbar provides standard Undo Ctrl-Z /Redo Ctrl-Y (multiple) and Cut
Ctrl-X, Copy Ctrl-C, Paste Ctrl-V functionality. You can also quickly clear
the Edit area (Alt-T) or the Result area (Alt-A).
The edit area is in fact a dual zone : you can swap from Edit Area 1 to Edit
Area 2 by clicking the I/II Switch. Edit area texts are persistant from one execution
of Dbj to the other (Stored in txt files in the DBJ installation directory).
The schema tool provides two convenient functionalities to understand and manage your database schemas : Schema Info and Compare Tool.
This dialog provides an easy way to browse your schema. Clicking "Get Report" allows to build the schema information. Before loading the report (a resource-consuming operation...) you can unselect the "With table size" option to speed up the process. You can then see your tables and columns in a tree view, two types of grids (one detailed view with one row per column and one with only one row per table), or a browser that shows 1 table at a time with related tables (using foreign keys metadata). In the grid views, double clicking a row will directly display the detailed view of this table. In the browser view, by clicking on a related table, you move this one to the main position. You can directly show another table by clicking in the table title.
This tool provides the ability to check structural differences between two
schemas, or between the same schema at different times (what changes did occur).
To use this tool, you can create a "schema control file" of the schema
you are currently connected to by clicking on the "Create File" button.
A "schema control file" is a snapshot of your database schema structure
- stored in a convenient XML structured file.
You can either compare the current schema with a previously created "schema
control file", or compare two saved "schema control files".
The comparison will provide you the new tables, removed tables, and "changed
tables" : in this case, it will provide also what has changed : new, deleted
or columns with changed datatypes, added or deleted constraints like primary
or foreign keys...
Some options allow you to remove some of the checks done, to reduce the verbosity
of the output if you know you will get differences...
You can access the table tool from the menu or directly from the question mark attached to the table combo box in the main window. Access to the table tool is also availble by double-clicking a table in the grid views from the schema info dialog. Three functionalities are provided: Table structure info, Data browser and update, Accessor maker. You can browse from one table to the other by clicking in the table name (A combo box will show up).
This tab shows the list of columns of the table, the foreign keys declared from/to this table, and defined indexes.
This tab presents the data content of the table. A right-click provides grid
functionality, Export, Print, Find (like on all Dbj grids). You can double-click
and directly modify the data, or you can also import a token-separated-values
file. Data will not be changed directly in the database, you have to click on
"Submit inserts" or "Submit updates" to review the script
that will be executed. Submitting Inserts will issue a "Delete All"
then all required insert statements to get the data as it was fetched then manually
modified. Submitting Updates will issue only the Update statements.
Before submitting the statements, review carefully the script: depending on
the RDBMS functionality, the primary key defined on the table, it may not execute
exactly what you expected.
Based on the table structure, this tool allows you to quickly generate code (Java, Php, Visual basic, whatever...) based on a template row and tokens. The "Styles" button will allow to alter this functionality. The best way to understand this functionality is to play with it and see if it is of any use for you - it never impacts the database so you can really play and test everything on it.
This is a simple table creation wizard, that builds a "CREATE TABLE"
statement that you can either submit or copy in the clipboard. Available datatypes
are the ones and only ones allowed by your RDBMS (As provided by the JDBC driver).
You can also create a table by copying the existing structure from another table,
by clicking the "Copy" button. Be careful : this only copies the structure
and not the table content !
Another feature allows to create a table by profiling a csv file : it will create a structure that is compatible with the csv file, potentially using columns names from the header row.
You can also
generate a full model, by analyzing a "PBIT" file : these are PowerBI
templates, that define a model structure in JSon. Tables are defined
without any relationship or primary key.
This tool is very convenient for reverse-engineering an application database
model... It can search all tables - or a subset of tables - for a specific data
content. You can search data starting with, equal to or containing some data.
First you have to enter the text you are looking for, and select in wich columns
of wich tables you want to find it. Be careful to use compliant datatypes and
data. To ease table/column selection you can of course sort by datatype, in
order for instance to only select Varchar columns.
Then you can click the "Search" button. This will issue all the required
"SELECT" statements (One per selected column in the "Search in"
list... This can be very resource-consuming !). Results will show the table
and column in which the data has been found, the primary key information to
find in which row it has been found, and the value itself.
This tool allows execution of the SAME statement on MULTIPLE databases... You can select the different connections from the ones that you defined in the "Connection" menu. Type a statement. The results from all connections will be stored in an output file. You can either stop on errors or go on executing the statement on the next connection. This can be handy to check, for instance, in which of your 20 instances you do not have a table created... But you can find many other utilizations !
The "Preferences" dialog (from the Tools menu) allows you to