Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ide/db/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

javac.compilerargs=-Xlint -Xlint:-serial
javac.source=1.8
javac.release=11
javadoc.arch=${basedir}/arch.xml
javadoc.apichanges=${basedir}/apichanges.xml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,8 @@ private void doConnect() throws DDLException {

throw ddle;
} catch (Throwable t) {
// Log JDBC errors that extend from Error rather than Exception, e.g. a NoClassDefFoundError originating from a JDBC driver.
LOGGER.log(Level.WARNING, "JDBC connection error", t); // NOI18N
String message = NbBundle.getMessage (DatabaseConnection.class, "EXC_CannotEstablishConnection", // NOI18N
db, drv, t.getMessage());
DialogDisplayer.getDefault ().notifyLater (new NotifyDescriptor.Exception (t, message));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.lang.reflect.InvocationTargetException;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
Expand All @@ -41,6 +40,7 @@
import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import org.netbeans.api.db.explorer.JDBCDriver;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.netbeans.lib.ddl.DDLException;
Expand All @@ -54,6 +54,8 @@
import org.netbeans.modules.db.explorer.dlg.ConnectionDialog;
import org.netbeans.modules.db.explorer.dlg.ConnectionDialogMediator;
import org.netbeans.modules.db.explorer.dlg.SchemaPanel;
import org.netbeans.modules.db.util.DriverListUtil;
import org.netbeans.modules.db.util.JdbcUrl;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
Expand All @@ -62,7 +64,6 @@
import org.openide.awt.ActionRegistration;
import org.openide.awt.ActionState;
import org.openide.util.ContextAwareAction;
import org.openide.util.Exceptions;
import org.openide.util.HelpCtx;
import org.openide.util.Lookup;
import org.openide.util.Mutex;
Expand Down Expand Up @@ -370,13 +371,20 @@ protected boolean retrieveSchemas(SchemaPanel schemaPanel, DatabaseConnection db
}

private boolean supportsConnectWithoutUsername(DatabaseConnection dc) {
try {
return dc.findJDBCDriver().getClassName().equals("org.sqlite.JDBC") //NOI18N
|| dc.findJDBCDriver().getClassName().equals("org.h2.Driver"); //NOI18N
} catch (NullPointerException ex) {
// Most probably findJDBCDriver failed to find a driver
JDBCDriver driver = dc.findJDBCDriver();
if (driver == null) {
return false;
}
List<JdbcUrl> urls = DriverListUtil.getJdbcUrls(driver);
if (urls.isEmpty()) {
return false;
}
for (JdbcUrl url : urls) {
if (url.isUsernamePasswordDisplayed()) {
return false;
}
}
return true;
}

private void connectWithNewInfo(DatabaseConnection dbcon, Credentials input) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ ACS_AddDriverProgressBarA11yDesc=Progress bar showing the progress of searching
# Select driver file chooser
AddDriver_Chooser_Title=Select Driver
AddDriver_Chooser_Filter=Archive Files (*.jar, *.zip)
# Select database file chooser
NewConnectionFile_Chooser_Title=Select Database File

NewConnectionDialogTitle=New Database Connection
NewConnectionDriverName=Driver &Name:
Expand All @@ -66,6 +68,7 @@ NewConnectionSID=Service ID (SID):
NewConnectionServiceName=Service:
NewConnectionTNSName=TNS Name:
NewConnectionDSN=DSN:
NewConnectionFile=&File:
NewConnectionInstanceName=Instance Name:
NewCOnnectionInputMode=Data Input &Mode:
NewConnectionFieldEntryMode=&Field Entry
Expand Down Expand Up @@ -105,6 +108,8 @@ ACS_NewConnectionTNSNameA11yDesc=The TNS name for this connection
ACS_NewConnectionTNSNameTextFieldA11yName=Database server TNS text field
ACS_NewConnectionDSNA11yDesc=The data source name for this connection
ACS_NewConnectionDSNTextFieldA11yName=Database server data source name (DSN) text field
ACS_NewConnectionFileA11yDesc=The database file for this connection
ACS_NewConnectionFileTextFieldA11yName=Database file name text field
ACS_NewConnectionInstanceNameA11yDesc=The instance name for this connection
ACS_NewConnectionInstanceNameTextFieldA11yName=Database server instance name text field
ACS_NewConnectionFieldEntryModeA11yDesc=Select this mode to enter individual field values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<Component id="instanceLabel" alignment="0" max="32767" attributes="1"/>
<Component id="serverNameLabel" alignment="0" max="32767" attributes="1"/>
<Component id="dsnLabel" alignment="0" max="32767" attributes="1"/>
<Component id="fileLabel" alignment="0" max="32767" attributes="1"/>
<Component id="tnsLabel" alignment="0" max="32767" attributes="1"/>
<Component id="serviceLabel" alignment="0" max="32767" attributes="1"/>
<Component id="sidLabel" alignment="0" max="32767" attributes="1"/>
Expand All @@ -73,7 +74,7 @@
<Component id="bConnectionProperties" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="bTestConnection" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="100" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Component id="userField" alignment="1" max="32767" attributes="2"/>
<Component id="sidField" alignment="0" max="32767" attributes="2"/>
Expand All @@ -97,6 +98,11 @@
<Component id="passwordCheckBox" min="-2" pref="256" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="fileField" max="32767" attributes="2"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="fileBrowseButton" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
Expand Down Expand Up @@ -149,6 +155,12 @@
<Component id="dsnField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="fileLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="fileField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="fileBrowseButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="serverNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="serverNameField" alignment="3" min="-2" max="-2" attributes="0"/>
Expand Down Expand Up @@ -400,6 +412,31 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="fileLabel">
<Properties>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="fileField"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/db/explorer/dlg/Bundle.properties" key="NewConnectionFile" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="fileField">
<Properties>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/db/explorer/dlg/Bundle.properties" key="ACS_NewConnectionFileA11yDesc" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="fileBrowseButton">
<Properties>
<Property name="text" type="java.lang.String" value="&amp;Browse..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="fileBrowseButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="urlField">
<Properties>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
Expand Down
Loading
Loading