Этот код использует java.net.InterfaceAddress для проверки работоспособности интерфейсов. С этого момента тип соединения легко определяется с помощью метода .getDisplayName (). Я изменил код из https://examples.javacodegeeks.com/core-java/net/networkinterface/java-net-networkinterface-example/
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Collections;
import org.apache.commons.lang.StringUtils;
public class networkConnectionTeller {
public static boolean isNetworkRunningViaCellular() throws SocketException {
String s = "";
// NetworkInterface implements a static method that returns all the
//interfaces on the PC,
// which we add on a list in order to iterate over them.
ArrayList interfaces =
Collections.list(NetworkInterface.getNetworkInterfaces());
s += ("Printing information about the available interfaces...\n");
for (Object ifaceO : interfaces) {
NetworkInterface iface = (NetworkInterface) ifaceO;
// Due to the amount of the interfaces, we will only print info
// about the interfaces that are actually online.
if (iface.isUp() &&
!StringUtils.containsIgnoreCase(iface.getDisplayName(), "loopback")) {
//Don`t want to see software loopback interfaces
// Display name
s += ("Interface name: " + iface.getDisplayName() + "\n");
// Interface addresses of the network interface
s += ("\tInterface addresses: ");
for (InterfaceAddress addr : iface.getInterfaceAddresses()) {
s += ("\t\t" + addr.getAddress().toString() + "\n");
}
// MTU (Maximum Transmission Unit)
s += ("\tMTU: " + iface.getMTU() + "\n");
// Subinterfaces
s += ("\tSubinterfaces: " +
Collections.list(iface.getSubInterfaces()) + "\n");
// Check other information regarding the interface
s += ("\tis loopback: " + iface.isLoopback() + "\n");
s += ("\tis virtual: " + iface.isVirtual() + "\n");
s += ("\tis point to point: " + iface.isPointToPoint() + "\n");
System.out.println(s);
if (iface.getDisplayName().contains("Broadband")) {
return true;
}
}
}
return false;
}
}
INSERT INTO new_db.dbo.TableA
SELECT * FROM old_db.dbo.TableB
Если таблицы являются тем же, это - вероятно, самый легкий путь.
SQL Server Integration Services (ранее известный как Службы преобразования данных) является способом пойти.
Импорт SQL Server и мастер данных Экспорта работают на простые задачи вполне прилично.
SQL Server Integration Services будет Вашим лучшим выбором. Если Вы знакомы с пакетами SQL 2000 DTS, Вы не должны испытывать слишком много затруднений при выяснении пакетов SSIS.