@node newconnection
@section Connecting to a database
@cindex Connecting to a database

You can connect to a database by selecting the @strong{File|New Connection} menu entry or the toolbar button. For more information about the menu and toolbar @pxref{window,Elements of the main window}.

After selecting the menu you will be presented with the following dialog.

@image{images/newconnection,12cm}

The filling out of this dialog is pretty straight forward but the options can vary depending on the selected connection provider.

@table @asis

@item @strong{Previous}
      This list contains the previous connection made, selecting an entry from this list will set all the values to the right to the correct. Doubleclicking will connect straight away (only makes sense if you save passwords).
@item @strong{Connections}
      Values to connect to this database again.
@item @strong{Connection provider}
      The type of connection to create. TOra currently supports Teradata, PostgrSQL, Oracle and MySQL.
@item @strong{Username}
      The username with which to connect to the database
@item @strong{Password}
      The password to use for the connection. You can also configure TOra to remember your last used password (@pxref{preferences,Options})
@item @strong{Use SQL*Net}
      This is perhaps the most difficult setting. This indicates whether to connect locally to the database or use SQL*Net. If you check this box the connection is made through the Oracle listener, otherwise a local connection usually using shared memory or named pipes is made. This is only available for Oracle connections.
@item @strong{Hostname}
      The host on which the database resides.
@item @strong{Database}
      What database to connect to. For Oracle, the listbox is filled with the values available in your tnsnames.ora file.
@item @strong{Connection Mode}
      The type of connection to make. For Oracle, usually @strong{normal} always suffices here. But sometimes during database administration @strong{SYS_DBA} or @strong{SYS_OPER} is needed. If you don't know what these mean you probably shouldn't be using them.
@item @strong{Color Session Identifier}
      You can flag connections with an identfier. The pre-configured identifiers are @strong{None} with no color, @strong{Testing} in blue, @strong{Development} in green and @strong{Production} in red, but you can change the associated colors and even add some more (@pxref{preferences,Options}).
@item @strong{Test button}
      This button lets you test the configured connection without actually saving it.
@item @strong{Save button}
      Using this button you can save the connection. Useful if you want to change something like passwords or color identifiers when you normally don't want to connect.
@item @strong{Import Connections}
      You can import connections from TOra 1.3.x, Oracle SQL Developer 1.5 and SqirrelSQL 2.6.x. The import dialog is pretty straight forward, just select the type you wish to import and press @strong{Run}.
@end table

Upon establishing a successful connection all the settings of the dialog will be saved and remembered when the next connection is made.

