Skip to content

Commit 4d916a6

Browse files
committed
WIP: SQLDEV-2076 Add ConnectionHelper example
Initial set up for new extension development on Mac
1 parent e995ca2 commit 4d916a6

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed

sqldeveloper/extension/build.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# This is where the builds will deploy the extension
77
# and where we can find our dependencies
88
#sqldev.dir=D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper
9-
sqldev.dir=D:/sqldeveloper-19.2.1/sqldeveloper
9+
#sqldev.dir=D:/sqldeveloper-19.2.1/sqldeveloper
10+
sqldev.dir=/Users/bjeffrie/eclipse-workspace-20.1/sql-developer/ide
1011

1112
# Information about the company or person creating the extension
1213
extension.owner=Oracle Examples
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SQL Developer Examples
2+
## ConnectionHelper
3+
Accept connection info from the command line (and maybe on a [SocketServer](https://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html))
4+
5+
### Command Line
6+
sqldeveloper -_conName_**=**_user_\[_**/**_\[_pw_]]**@**_host_**:**_port_(**:**_sid_|**/**_svc_)\[**#**_role_]
7+
8+
Where:
9+
- *connName* is the name you would like for the connection
10+
- *user* is the user name for the schema you want to use
11+
- */password* is the password for that user *(optional - if missing e.g., user@ or user/@, SQLDeveloper will prompt for it)*
12+
- *host* is the host that the database is on
13+
- *port* is the port the database is listening on
14+
- *:sid* is the sid for the database *(One of :sid or /svc MUST be supplied)*
15+
- */svc* is the service name for the database *(One of :sid or /svc MUST be supplied)*
16+
- *#role* is the role *(optional - one of SYSDBA, SYSOPER, SYSBACKUP, SYSDG, SYSKM, SYSASM if used)*
17+
18+
### [ConnectionHelperAddin](src/oracle/db/example/sqldeveloper/extension/connectionhelper/ConnectionHelperAddin.java)
19+
1. Creates the requested connection in a "Transient" folder
20+
2. Navigates to and opens the new connection
21+
3. Sets up a hook to remove the connection when SQLDeveloper shuts down
22+
23+
### TODO
24+
* Preference page _(May need/want preference page as a load trigger hook)_
25+
* CheckBox: Accept connection info on command line [false]
26+
* CheckBox: Persist command line connections [false]
27+
* [SocketServer](https://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html)
28+
* Preference page
29+
* NumericSpinner: Listener port [4444]
30+
* CheckBox: Autostart server
31+
* Button: Start now
32+
* Simple client test app for [SocketServer](https://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html)
33+
34+

sqldeveloper/extension/java/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ a PLDoc template if PL/Scope information is available.
1919

2020
* [InsertTemplateAction](InsertTemplateAction)
2121
A quick context menu action on code editor to insert a template string for @maternaDev01
22+
23+
* [ConnectionHelper](ConnectionHelper)
24+
Accept connection info from the command line (and maybe on a [SocketServer](https://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html))

sqldeveloper/extension/setenv.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export ANT_HOME=/usr/local/Cellar/ant/1.10.5
2+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home
3+
export ANT_BIN=${ANT_HOME}/bin
4+
export SQLDEV_BIN=/Users/bjeffrie/eclipse-workspace-20.1/sql-developer/ide/sqldeveloper/bin
5+
export PATH=${PATH}:${ANT_BIN}:${SQLDEV_BIN}
6+

sqldeveloper/extension/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## First things first: Getting the pieces
44

55
### Java JDK 8
6-
We are currently using [jdk1.8](http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html)
6+
We are currently using [jdk1.8](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html)
77

88
### SQL Developer
99
You'll need a copy of [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/) both as a deployment location for testing and as the source for required library files.

0 commit comments

Comments
 (0)