-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathGXutil.java
More file actions
1785 lines (1470 loc) · 42.8 KB
/
GXutil.java
File metadata and controls
1785 lines (1470 loc) · 42.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package com.genexus;
import java.io.*;
import java.math.BigDecimal;
import java.nio.file.Paths;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import com.genexus.common.interfaces.SpecificImplementation;
import com.genexus.db.DataStoreProvider;
import com.genexus.db.GXEmbedding;
import com.genexus.internet.HttpContext;
import com.genexus.internet.StringCollection;
import com.genexus.platform.INativeFunctions;
import com.genexus.platform.NativeFunctions;
import com.genexus.util.*;
import org.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
public final class GXutil
{
public static boolean Confirmed = false;
public static void writeLogInfo(String message)
{
CommonUtil.writeLogInfo(message);
}
public static void writeLogError(String message)
{
CommonUtil.writeLogError(message);
}
public static void writeLogln( String message)
{
CommonUtil.writeLogln(message);
}
public static void writeTLogln( String message)
{
CommonUtil.writeTLogln(message);
}
public static void writeLogRaw( String message, Object obj)
{
CommonUtil.writeLogRaw(message, obj);
}
public static void writeLog( String message)
{
CommonUtil.writeLog(message);
}
public static String accessKey(String OCaption)
{
return CommonUtil.accessKey(OCaption);
}
public static String accessKeyCaption(String OCaption)
{
return CommonUtil.accessKeyCaption(OCaption);
}
public static Calendar getCalendar()
{
return CommonUtil.getCalendar();
}
public static String newLine()
{
return CommonUtil.newLine();
}
public static String getHost(String hostAndPort)
{
return CommonUtil.getHost(hostAndPort);
}
public static int getPort(String hostAndPort)
{
return getPort(hostAndPort, 0);
}
public static int getPort(String hostAndPort, int def)
{
return CommonUtil.getPort(hostAndPort, def);
}
public static String link(String url, int newWindow)
{
PrivateUtilities.displayURL(url);
return "";
}
public static byte deleteFile(String fileName)
{
return CommonUtil.deleteFile(fileName);
}
public static double mod(double value, double div)
{
return CommonUtil.mod(value, div);
}
public static double random()
{
return CommonUtil.random();
}
public static int rseed(double[] seed)
{
return CommonUtil.rseed(seed);
}
public static int rseed(long seed)
{
return CommonUtil.rseed(seed);
}
public static byte fileExists(String fileName)
{
if (!fileName.startsWith("http")){
File file = new File(fileName);
return (file.isFile() && file.exists())? (byte)1:0;
}
else
{
return PrivateUtilities.remoteFileExists(fileName);
}
}
public static double rand()
{
return CommonUtil.rand();
}
public static int aleat()
{
return CommonUtil.aleat();
}
public static String format(long value, String picture)
{
return CommonUtil.format(value, picture);
}
public static String format(double value, String picture)
{
return CommonUtil.format(value, picture);
}
public static String format(String value, String picture)
{
return value;
}
public static String format(java.util.Date value, String picture)
{
return value.toString();
}
public static String formatDateTimeParm(Date date)
{
return CommonUtil.formatDateTimeParm(date);
}
public static String formatDateTimeParmMS(Date date)
{
return CommonUtil.formatDateTimeParmMS(date);
}
public static String formatDateParm(Date date)
{
return CommonUtil.formatDateParm(date);
}
public static String formatDateParm(Date[] date)
{
return formatDateParm(date[0]);
}
public static String delete(String text,char del)
{
return (CommonUtil.trimSpaces(text.replace(del,' ')));
}
public static boolean isTime(String text)
{
return CommonUtil.isTime(text);
}
public static String alltrim(String text)
{
return CommonUtil.alltrim(text);
}
public static String rtrim(String text)
{
return CommonUtil.rtrim(text);
}
public static String rtrim(String[] text)
{
return CommonUtil.rtrim(text[0]);
}
public static String rtrim(String[][] text)
{
return CommonUtil.rtrim(text[0][0]);
}
public static boolean endsWith(String s1, String s2)
{
return CommonUtil.endsWith(s1, s2);
}
public static boolean startsWith(String s1, String s2)
{
return CommonUtil.startsWith(s1, s2);
}
public static boolean contains(String s1, String s2)
{
return CommonUtil.contains(s1, s2);
}
public static String charAt(String s1, int idx)
{
return CommonUtil.charAt(s1, idx);
}
public static String substring (String text, int start, int end)
{
return CommonUtil.substring(text, start, end);
}
public static String substringByte(String text, int lenInBytes, String encoding)
{
return CommonUtil.substringByte(text, lenInBytes, encoding);
}
public static Date ymdhmsToT_noYL(String yyyymmddhhmmss)
{
return CommonUtil.ymdhmsToT_noYL(yyyymmddhhmmss);
}
public static Date resetDate(Date date)
{
return CommonUtil.resetDate(date);
}
public static Date ymdhmsToT_noYL(int year, int month, int day , int hour , int minute , int second)
{
return ymdhmsToT_noYL(year, month, day, hour, minute, second, 0);
}
public static Date ymdhmsToT_noYL(int year, int month, int day , int hour , int minute , int second, int millisecond)
{
return CommonUtil.ymdhmsToT_noYL(year, month, day, hour, minute, second, millisecond);
}
public static Date newNullDate()
{
return CommonUtil.newNullDate();
}
public static Date nullDate()
{
return CommonUtil.nullDate();
}
public static Date resetTime(Date dt)
{
return CommonUtil.resetTime(dt);
}
public static Date resetMillis(Date dt)
{
return CommonUtil.resetMillis(dt);
}
public static Date now()
{
return now(true,false);
}
public static Date now(boolean useClientTimeZone)
{
return now(useClientTimeZone,false);
}
public static Date nowms()
{
return now(true, true);
}
public static Date now(boolean useClientTimeZone, boolean millisecond)
{
return SpecificImplementation.GXutil.now(useClientTimeZone, millisecond);
}
public static short CurrentTimeOffset()
{
return getUTCOffset(now());
}
public static int datecmp( Date left , Date right)
{
return CommonUtil.datecmp(left, right);
}
public static boolean dateCompare( Date left , Date right)
{
return CommonUtil.dateCompare(left, right);
}
public static int strcmp( String left ,
String right )
{
return CommonUtil.strcmp(left, right);
}
public static boolean strcmp2( String left ,
String right )
{
return CommonUtil.strcmp2(left, right);
}
public static int guidCompare(java.util.UUID guidA, java.util.UUID guidB, int mode)
{
return CommonUtil.guidCompare(guidA, guidB, mode);
}
public static Date setTime(Date dt, int time)
{
return resetTime(dt);
}
public static Date today()
{
return (resetTime(now()));
}
public static short getUTCOffset(Date value)
{
return CommonUtil.getUTCOffset(value);
}
public static Date DateTimetoCurrentTime(Date value, int Offset)
{
return CommonUtil.DateTimetoCurrentTime(value, Offset);
}
static public Date DateTimefromTimeZone(Date dt, String sTz)
{
return DateTimefromTimeZone( dt, sTz, ModelContext.getModelContext());
}
static public Date DateTimefromTimeZone(Date dt, String sTz, ModelContext context)
{
TimeZone fromTimeZone = TimeZone.getTimeZone( sTz);
if (fromTimeZone.getID().equals(sTz))
return ConvertDateTime( dt, fromTimeZone, context.getClientTimeZone());
return dt;
}
public static Date ConvertDateTime(Date dt, TimeZone FromTimezone, TimeZone ToTimezone)
{
return DateTimeFromUTC(DateTimeToUTC(dt, FromTimezone), ToTimezone);
}
public static boolean emptyDate( Date value)
{
return CommonUtil.emptyDate(value);
}
public static Date DateTimeToUTC(Date value)
{
if ( emptyDate( value))
return value;
if (ModelContext.getModelContext() == null)
{
TimeZone tz = (TimeZone)com.genexus.GXutil.threadTimeZone.get();
if (tz != null)
return DateTimeToUTC(value, tz);
else
return DateTimeToUTC(value, TimeZone.getDefault());
}
else
return DateTimeToUTC(value, ModelContext.getModelContext().getClientTimeZone());
}
public static Date DateTimeToUTC(Date value, TimeZone tz)
{
return CommonUtil.DateTimeToUTC(value, tz);
}
public static Date DateTimeFromUTC(Date value)
{
return CommonUtil.DateTimeFromUTC( value, TimeZone.getDefault());
}
public static Date DateTimeFromUTC(Date value, TimeZone tz)
{
return CommonUtil.DateTimeFromUTC(value, tz);
}
public static Date DateToUTC(Date value)
{
return CommonUtil.resetTime(DateTimeToUTC(value));
}
public static IThreadLocal threadTimeZone = GXThreadLocal.newThreadLocal();
public static void setThreadTimeZone(TimeZone tz)
{
threadTimeZone.set(tz);
}
public static String formatLong(long number)
{
return CommonUtil.formatLong(number);
}
public static String booltostr(boolean val){
return CommonUtil.booltostr(val);
}
public static boolean strtobool(String val)
{
return CommonUtil.strtobool(val);
}
public static String str(long val, int digits, int decimals)
{
return CommonUtil.str(val, digits, decimals);
}
public static String str(java.math.BigDecimal value, int length, int decimals)
{
return CommonUtil.str(value, length, decimals, true);
}
public static String strNoRound(java.math.BigDecimal value, int length, int decimals)
{
return CommonUtil.str(value, length, decimals, false);
}
// Esto es que hizo str(_, 2, 1) o str(_, 3, 2), todas cosas
// invalidas que implican que decimals = 0
// Aca el numero tiene el valor redondeado y tiene los decimales correctos. Ahora
// hay que empezar a achicarlo si no entra en el espacio indicado.
public static String str(int[] value, int length, int decimals)
{
return str(value[0], length, decimals);
}
public static String str(double value, int length, int decimals)
{
return CommonUtil.str(value, length, decimals);
}
public static String strNoRound(double value, int length, int decimals)
{
return CommonUtil.strNoRound(value, length, decimals);
}
public static String strori(double val, int digits, int decimals)
{
if (decimals < 0) decimals = 0;
if (digits < 0) digits = 0;
StringBuffer b = new StringBuffer();
boolean hasSign = (val < 0);
if (hasSign)
{
b.append('-');
val = -val;
}
val = round(val, decimals);
int intDigits = 0;
if (val < 1)
{
intDigits = val == 0?1:(int) log10(val) ;
}
else
{
intDigits = val == 0?1:(int) log10(val) + 1;
}
if (intDigits + (hasSign?1:0) > digits)
return CommonUtil.replicate("*", digits);
if (intDigits <= 0)
{
int realDigits = -intDigits;
realDigits = realDigits > decimals?decimals:realDigits;
b.append("0." + CommonUtil.replicate("0", realDigits));
}
for (int i = intDigits -1; i >= -decimals ; i--)
{
double divi = Math.pow(10, i);
int cur = (int) ( (val / divi) + 0.000001);
//BigDecimal divi2 = new BigDecimal(Math.pow(10, i));
//int cur = unexponentString(Double.toString(val)).divide(divi2, 0).intValue();
val = round(val - (divi * cur), decimals);
if (b.length() < digits)
{
if (i == 0 && decimals > 0)
{
if (digits > b.length() + 2)
{
b.append( (int) cur);
b.append('.');
}
else
{
int cur_tmp = (int) ( (val / Math.pow(10, i-1)) + 0.000001);
b.append( (int) cur + (cur_tmp >= 5?1:0) );
break;
}
}
else
{
b.append( (int) cur);
}
}
}
return padl(b.toString(), digits, " ");
}
public static double log10(double val)
{
return CommonUtil.log10(val);
}
public static int strSearch(String a, String b, int from)
{
return CommonUtil.strSearch(a, b, from);
}
public static int strSearch(String a, String b)
{
return CommonUtil.strSearch(a, b, 0);
}
public static int strSearchRev(String a, String b)
{
return CommonUtil.strSearchRev(a, b);
}
public static int strSearchRev(String a, String b, int from)
{
return CommonUtil.strSearchRev(a, b, from);
}
public static String strReplace(String s, String subString, String replacement)
{
return CommonUtil.strReplace(s, subString, replacement);
}
public static String padstr(int number, int length)
{
return CommonUtil.padl(CommonUtil.ltrim(str(number, length, 0)), length, "0");
}
public static String padr(String text, int size, String fill)
{
return CommonUtil.padr(text, size, fill);
}
public static String padl(String text, int size, String fill)
{
return CommonUtil.padl(text, size, fill);
}
public static String right(String text, int size)
{
return CommonUtil.right(text, size);
}
public static String left(String text, int size)
{
return CommonUtil.left(text, size);
}
public static String replicate(char character, int size)
{
return CommonUtil.replicate(character, size);
}
public static String replicate(String character, int size, int a)
{
return CommonUtil.replicate(character, size, a);
}
public static final String replicate(String character, int size)
{
return CommonUtil.replicate(character, size);
}
public static String ltrim(String text)
{
return CommonUtil.ltrim(text);
}
public static String ltrimstr(long val, int digits, int decimals)
{
return CommonUtil.ltrimstr(val, digits, decimals);
}
public static String ltrimstr(long[] val, int digits, int decimals)
{
return ltrimstr(val[0], digits, decimals);
}
public static String ltrimstr(java.math.BigDecimal value, int length, int decimals)
{
return CommonUtil.ltrimstr(value, length, decimals);
}
public static String ltrimstr(java.math.BigDecimal[] value, int length, int decimals)
{
return ltrimstr(value[0], length, decimals);
}
public static String ltrimstr(double value, int length, int decimals)
{
return CommonUtil.ltrimstr(value, length, decimals);
}
public static String ltrimstr(double[] value, int length, int decimals)
{
return ltrimstr(value[0], length, decimals);
}
public static String ltrimstr(int[] value, int length, int decimals)
{
return ltrimstr(value[0], length, decimals);
}
public static String ltrimstr(short[] value, int length, int decimals)
{
return ltrimstr(value[0], length, decimals);
}
public static String ltrimstr(byte[] value, int length, int decimals)
{
return ltrimstr(value[0], length, decimals);
}
public static String time()
{
return CommonUtil.time();
}
public static Date addmth(Date date, int cnt)
{
return CommonUtil.addmth(date, cnt);
}
public static long lval(String text)
{
return CommonUtil.lval(text);
}
public static double val(String text)
{
return CommonUtil.val(text);
}
public static double val(String text, String sDSep)
{
return CommonUtil.val(text, sDSep);
}
public static boolean notNumeric(String value)
{
return CommonUtil.notNumeric(value);
}
public static boolean boolval(String text)
{
return CommonUtil.boolval(text);
}
public static Date eomdate(Date date)
{
return CommonUtil.eomdate(date);
}
public static Date eom(Date date)
{
return CommonUtil.eom(date);
}
public static Date dtadd(Date date, int seconds)
{
return CommonUtil.dtadd(date, seconds);
}
public static Date dtadd(Date date, double seconds)
{
return CommonUtil.dtadd(date, seconds);
}
public static Date dtaddms(Date date, double seconds)
{
return CommonUtil.dtaddms(date, seconds);
}
public static Date dadd(Date date, int cnt)
{
return CommonUtil.dadd(date, cnt);
}
public static Date dadd(Date date, double cnt)
{
return dadd(date, (int)cnt);
}
public static long dtdiff(Date dateStart, Date dateEnd)
{
return CommonUtil.dtdiff(dateStart, dateEnd);
}
public static double dtdiffms(Date dateStart, Date dateEnd)
{
return CommonUtil.dtdiffms(dateStart, dateEnd);
}
public static int ddiff(Date dateStart, Date dateEnd)
{
return (int) round(dtdiff(dateStart, dateEnd) / 86400.0, 0);
}
public static String concat(String first, String second)
{
return CommonUtil.concat(first, second);
}
public static String concat(String first, String second, String separator)
{
return CommonUtil.concat(first, second, separator);
}
public static void msg(Date date)
{
PrivateUtilities.msg(Application.getClientLocalUtil().dtoc(date));
}
public static void msg(int sText)
{
PrivateUtilities.msg("" + sText);
}
public static void msg(String sText)
{
PrivateUtilities.msg(sText);
}
public static void msg(Object panel, String sText)
{
CommonUtil.msg(panel, sText);
}
public static void error(Object panel, String sText)
{
CommonUtil.error(panel, sText);
}
static public boolean like( String str, String ptrn)
{
return CommonUtil.like(str, ptrn);
}
static public boolean like( String str, String ptrn, char escape)
{
return CommonUtil.like(str, ptrn, escape);
}
public static Date addyr(Date date, int yr)
{
return CommonUtil.addyr(date, yr);
}
public static int age(Date fn, Date today)
{
return CommonUtil.age(fn, today);
}
public static int age(Date dateStart)
{
return CommonUtil.age(dateStart);
}
public static int hour(Date date )
{
return CommonUtil.hour(date);
}
public static int minute(Date date )
{
return CommonUtil.minute(date);
}
public static int second(Date date )
{
return CommonUtil.second(date);
}
public static int millisecond(Date date )
{
return CommonUtil.millisecond(date);
}
public static int day(Date date)
{
return CommonUtil.day(date);
}
public static int month(Date date)
{
return CommonUtil.month(date);
}
public static int year(Date date)
{
return CommonUtil.year(date);
}
public static String getYYYYMMDD(Date date)
{
return CommonUtil.getYYYYMMDD(date);
}
public static String getYYYYMMDDHHMMSS_nosep(Date date)
{
return CommonUtil.getYYYYMMDDHHMMSS_nosep(date);
}
public static String getYYYYMMDDHHMMSSmmm_nosep(Date date)
{
return CommonUtil.getYYYYMMDDHHMMSSmmm_nosep(date);
}
public static String getYYYYMMDDHHMMSS(Date date)
{
return CommonUtil.getYYYYMMDDHHMMSS(date);
}
public static String getYYYYMMDDHHMMSSmmm(Date date)
{
return CommonUtil.getYYYYMMDDHHMMSSmmm(date);
}
public static String getMMDDHHMMSS(Date date)
{
return CommonUtil.getMMDDHHMMSS(date);
}
public static int len(String text)
{
return CommonUtil.len(text);
}
public static int byteCount(String text, String encoding)
{
return CommonUtil.byteCount(text, encoding);
}
public static String space(int n)
{
return CommonUtil.space(n);
}
public static String trim(String text)
{
return CommonUtil.trim(text);
}
public static long Int(double num)
{
return CommonUtil.Int(num);
}
public static BigDecimal roundToEven(BigDecimal in, int decimals)
{
return CommonUtil.roundToEven(in, decimals);
}
public static BigDecimal roundDecimal(BigDecimal in, int decimals)
{
return CommonUtil.roundDecimal(in, decimals);
}
public static double round(double in, int decimals)
{
return CommonUtil.round(in, decimals);
}
public static BigDecimal truncDecimal(BigDecimal num , int decimals)
{
return CommonUtil.truncDecimal(num, decimals);
}
public static double trunc(double num , int decimals)
{
return truncDecimal(DecimalUtil.unexponentString(Double.toString(num)), decimals).doubleValue();
}
public static byte dow(Date date)
{
return CommonUtil.dow(date);
}
protected static boolean in(String text , char c)
{
return CommonUtil.in(text, c);
}
public static String getTimeFormat(String time)
{
return CommonUtil.getTimeFormat(time);
}
public static String chr(int asciiValue)
{
return CommonUtil.chr(asciiValue);
}
public static int asc(String value)
{
return CommonUtil.asc(value);
}
public static String wrkst()
{
return NativeFunctions.getInstance().getWorkstationName();
}
public static int dbmsVersion(ModelContext context, int handle, String dataSource)
{
String version = Application.getDBMSVersion(context, handle, dataSource);
return Integer.valueOf(version.substring(0, version.indexOf(".")));
}
public static boolean isSQLSERVER2005(ModelContext context, int handle, String dataSource)
{
return (dbmsVersion(context, handle, dataSource) >= 9);
}
public static String databaseName(ModelContext context, int handle, String dataSource)
{
return SpecificImplementation.GXutil.getDatabaseName(context, handle, dataSource);
}
/**
* @deprecated use serverNow(ModelContext context, int handle, com.genexus.db.IDataStoreProvider dataStore);
* */
public static Date serverNow(ModelContext context, int handle, String dataSource)
{
return SpecificImplementation.GXutil.serverNow(context, handle, dataSource);
}
public static Date serverNow(ModelContext context, int handle, com.genexus.db.IDataStoreProvider dataStore)
{
if (dataStore == null)
dataStore = new DataStoreProvider(context, handle);
return serverNow( context, handle, dataStore, false);
}
public static Date serverNowMs(ModelContext context, int handle, com.genexus.db.IDataStoreProvider dataStore)
{
if (dataStore == null)
dataStore = new DataStoreProvider(context, handle);
return serverNow( context, handle, dataStore, true);
}
public static Date serverNow(ModelContext context, int handle, com.genexus.db.IDataStoreProvider dataStore, boolean millisecond)
{
if (dataStore == null)
dataStore = new DataStoreProvider(context, handle);
return SpecificImplementation.GXutil.serverNow(context, handle, dataStore, millisecond);
}
/**
* @deprecated use serverTime(ModelContext context, int handle, com.genexus.db.IDataStoreProvider dataStore);
* */