23
23
import java .sql .SQLException ;
24
24
import java .sql .Statement ;
25
25
import java .util .Calendar ;
26
- import java .util .Locale ;
27
- import java .util .TimeZone ;
28
26
29
27
import org .apache .arrow .memory .BaseAllocator ;
30
28
import org .apache .arrow .memory .RootAllocator ;
@@ -90,7 +88,7 @@ public static VectorSchemaRoot sqlToArrow(Connection connection, String query, B
90
88
Preconditions .checkNotNull (allocator , "Memory allocator object can not be null" );
91
89
92
90
JdbcToArrowConfig config =
93
- new JdbcToArrowConfig (allocator , Calendar . getInstance ( TimeZone . getTimeZone ( "UTC" ), Locale . ROOT ), false );
91
+ new JdbcToArrowConfig (allocator , JdbcToArrowUtils . getUtcCalendar ( ), false );
94
92
return sqlToArrow (connection , query , config );
95
93
}
96
94
@@ -155,7 +153,7 @@ public static VectorSchemaRoot sqlToArrow(Connection connection, String query, J
155
153
public static VectorSchemaRoot sqlToArrow (ResultSet resultSet ) throws SQLException , IOException {
156
154
Preconditions .checkNotNull (resultSet , "JDBC ResultSet object can not be null" );
157
155
158
- return sqlToArrow (resultSet , Calendar . getInstance ( TimeZone . getTimeZone ( "UTC" ), Locale . ROOT ));
156
+ return sqlToArrow (resultSet , JdbcToArrowUtils . getUtcCalendar ( ));
159
157
}
160
158
161
159
/**
@@ -172,7 +170,7 @@ public static VectorSchemaRoot sqlToArrow(ResultSet resultSet, BaseAllocator all
172
170
Preconditions .checkNotNull (allocator , "Memory Allocator object can not be null" );
173
171
174
172
JdbcToArrowConfig config =
175
- new JdbcToArrowConfig (allocator , Calendar . getInstance ( TimeZone . getTimeZone ( "UTC" ), Locale . ROOT ), false );
173
+ new JdbcToArrowConfig (allocator , JdbcToArrowUtils . getUtcCalendar ( ), false );
176
174
return sqlToArrow (resultSet , config );
177
175
}
178
176
0 commit comments