Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
- public static void main(String[] args) {
- try
- {
- Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
- String userName = "sa";
- String password = "34erdfcV";
- String url = "jdbc:sqlserver://адрессервера"+";databaseName=имяБД";
- Connection con = (Connection) DriverManager.getConnection(url, userName, password);
- Statement s1 = ((java.sql.Connection) con).createStatement();
- ResultSet rs = s1.executeQuery("SELECT TOP (1000) [idBuildings]rn" +
- " ,[lat1]rn" +
- " ,[lon1]rn" +
- " ,[id2gis]rn" +
- " ,[lat2]rn" +
- " ,[lon2]rn" +
- " ,[route1]rn" +
- " ,[DistanceP]rn" +
- " ,[DistanceM]rn" +
- " ,[TimeP]rn" +
- " ,[TimeM]rn" +
- " ,[PolygonP]rn" +
- " ,[PolygonM]rn" +
- " ,[Radius]rn" +
- " FROM [ast_2gis].[dbo].[rn_allRoutesNew]");
- String[] result = new String[20];
- if(rs!=null){
- while (rs.next()){
- for(int i = 0; i <result.length ;i++)
- {
- for(int j = 0; j <result.length;j++)
- {
- result[j]=rs.getString(i);
- System.out.println(result[j]);
- }
- }
- }
- }
- } catch (Exception e)
- {
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment