conn, ife, sop & try
conn, ife, sop & try
Oh, weird
language, isn't it.
These are the code templates I use
most often.
A code template is a nice feature of
JDeveloper.
You type a shortcut, eg try, followed by the
CTRL+Enter key combination and the equivalent template code
is added in the source editor,
at the point where your cursor was.
It
will also bring any associated imports.
For example,
typing conn in the source editor followed by the
CTRL+Enter key combination will add the following code:
String username = "scott";and the following imports:
String password = "tiger";
String thinConn = "jdbc:oracle:thin:@localhost:1521:ORCL";
DriverManager.registerDriver(new OracleDriver());
Connection conn = DriverManager.getConnection(thinConn,username,password);
conn.setAutoCommit(false);
return conn;
import java.sql.*;
import oracle.jdbc.OracleDriver;
I think it's worth you have a look at all the avalable shortcuts:
select menu Tools --> Preferences..., expand Code Editor and click Code Templates.
You can see there the shortcuts with a small description.
Selecting any shortcut displays the code as shown in the followin picture:

I had never defined my own template before, but I'll certainly do, after having read Frank's post in his blog:
How to automatically add the class name and creation date to a Java file
Frank explains there how you can create your own template, and take advantage of variables (new in JDeveloper 10.1.3).
In his example, a variable $file$ will automatically get assigned the name of the Class and $date$ the current date.
By googling, I see that Steve also explained How to Create a Code Template for JSTL Choose.
Great !