Bitte beraten Sie, wie Sie eine Verbindung in Java mit SQL Server Windows-Authentifizierungsmodus machen.Wie Sie eine Verbindung mit der Datenbank in Java mit Windows-Authentifizierung herstellen
Ich bin auf NetBeans 8.1 Arbeits
- Sie wissen, dass es so sollte kein Benutzername und Passwort ist, dass als Rohling im Frühjahr Batch-Programm database.xml gehalten werden?
Ist unten Bean xml korrekt?
Hier ist meine Bohne für JDBC-Verbindung erstellt
<bean id="dataSource1"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="sun.jdbc.odbc.JdbcOdbcDriver" />
<property name="url" value="jdbc:sqlserver://DESKTOP-7CI6DU0\\SQLEXPRESS:1433;databaseName=master" />
<property name="username" value="" />
<property name="password" value="" />
</bean>
Der Fehler, dass ich mit Blick auf M:
Compiling 6 source files to C:\Users\Nitish\Downloads\SMD\Spring_Batch_SendMail\build\classes
C:\Users\Nitish\Downloads\SMD\Spring_Batch_SendMail\src\SendMail\Mailitemwriter.java:58: error: cannot access DataAccessException
result += jdbcTemplate.update(UPDATE_QUERY, params);
class file for org.springframework.dao.DataAccessException not found Note: C:\Users\Nitish\Downloads\SMD\Spring_Batch_SendMail\src\SendMail\MailProg.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error C:\Users\Nitish\Downloads\SMD\Spring_Batch_SendMail\nbproject\build-impl.xml:929: The following error occurred while executing this line: C:\Users\Nitish\Downloads\SMD\Spring_Batch_SendMail\nbproject\build-impl.xml:269: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 1 second)