Java Doc for RKUtil.java in  » Database-Client » SQLMinus » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » SQLMinus » util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   util.RKUtil

RKUtil
public class RKUtil (Code)
utility class for some frontend checks and conversions.
author:
   Rahul Kumar
author:
   RK modified on 20021217 04:48:42
author:
   Added methods for next month,date,year etc




Method Summary
public static  StringCurrentDateString()
     returns current date in Indian format - UGH it returns date only, not time.
public static  StringCurrentSQLDateString()
     Returns a JDBC compliant date string for the current date Time is blanked out in the result.
public static  StringCurrentSQLTimeString()
     Returns a JDBC compliant datetime string for the current date This includes the current time.
public static  java.util.DateDateStringToDate(String d)
     converts a string that contains a date to a Date.
public static  java.sql.DateDateStringToSQLDate(String d)
     Takes a date string (that a user has entered) and returns a java.sql.Date.
public static  java.sql.DateDateStringToSQLDateTime(String d)
     converts a string that contains a date and time to a Date.
public static  java.sql.TimestampDateStringToSQLTimestamp(String d)
    
public static  StringDateTimeToDateString(java.util.Date d)
    
public static  StringDateTimeToDateString(java.sql.Timestamp d)
    
public static  StringDateToDateString(java.util.Date d)
    
public static  StringDateToString(java.util.Date d)
    
public static  StringDateToTimeString(java.util.Date d)
    
public static  java.util.DateFriendlyDateStringToDate(String d)
     Converts a given date string to a date.
public static  StringGenerateNewPassword()
    
public static  StringNextDateString(java.util.Date base, int unit, int period)
     int unit is Calendar.MONTH, YEAR or DATE int period is plus or minus months, days etc.
public static  intNextDay(java.util.Date base, int period)
     returns the day part as int given a base date and how many day from base.
public static  intNextMonth(java.util.Date base, int period)
     returns the month part as int given a base date and how many month from base.
public static  StringNextMonthString(java.util.Date base, int month)
     returns (full date for) months after or before given date, if no date passed then current date used.
public static  intNextPeriod(java.util.Date base, int unit, int period)
    
public static  intNextYear(java.util.Date base, int period)
     returns the year part as int given a base date and how many years from base.
public static  StringNextYearString(java.util.Date base, int year)
     returns full date for years from the given date.
public static  StringNullToString(String astring)
     if a string is null returns a blank else the string itself more for use in JSPs to cut down code.
public static  ConnectionOLDgetConnection()
    
public static  StringSQLDateToDateString(java.sql.Date d)
    
public static  StringUtilDateToSQLDate(java.util.Date UtilDate)
    
public static  StringfindFileInClassPath(String name)
    
public static  booleanisEmailValid(String text)
     checks for existence of "at" and "dot" in email in that order.
public static  booleanisNullString(String text)
     Validates whether the input string is blank.
public static  voidmain(String args)
    
public static  StringprintErrors(List errstr)
    
public static  String[]split(String st, char sep)
     splits a given string on given character separator returning an array of strings.



Method Detail
CurrentDateString
public static String CurrentDateString()(Code)
returns current date in Indian format - UGH it returns date only, not time.



CurrentSQLDateString
public static String CurrentSQLDateString()(Code)
Returns a JDBC compliant date string for the current date Time is blanked out in the result. Use this to update tables with system date.



CurrentSQLTimeString
public static String CurrentSQLTimeString()(Code)
Returns a JDBC compliant datetime string for the current date This includes the current time. Use this to update tables with system timestamp.



DateStringToDate
public static java.util.Date DateStringToDate(String d) throws ParseException(Code)
converts a string that contains a date to a Date. The entry string should not be null else a Nullpointer will be thrown
Parameters:
  String - in date format java.util.Date
throws:
  ParseException - if date is invalid or wrong format
throws:
  NullPointer - if input is blank We can probably formally throw a BlankStringexception in a future version so that the callers dont suffer NPE's.



DateStringToSQLDate
public static java.sql.Date DateStringToSQLDate(String d) throws ParseException(Code)
Takes a date string (that a user has entered) and returns a java.sql.Date. The return date can be carried all the way through to the backend. Please start using this and avoid util dates !!!
Parameters:
  String - date string from HTML form java.sql.Date date for the given string
throws:
  ParseException - if string contains invalid date



DateStringToSQLDateTime
public static java.sql.Date DateStringToSQLDateTime(String d) throws ParseException(Code)
converts a string that contains a date and time to a Date. The entry string should not be null else a Nullpointer will be thrown
Parameters:
  String - in date format java.util.Date
throws:
  ParseException - if date is invalid or wrong format
throws:
  NullPointer - if input is blank We can probably formally throw a BlankStringexception in a future version so that the callers dont suffer NPE's.



DateStringToSQLTimestamp
public static java.sql.Timestamp DateStringToSQLTimestamp(String d) throws ParseException(Code)



DateTimeToDateString
public static String DateTimeToDateString(java.util.Date d)(Code)
converts date to a string in indian format
Parameters:
  Date - to be converted - can be sql date or timestamp String in Indian Format



DateTimeToDateString
public static String DateTimeToDateString(java.sql.Timestamp d)(Code)



DateToDateString
public static String DateToDateString(java.util.Date d)(Code)
converts date to a string in indian format
Parameters:
  Date - to be converted String in Indian Format



DateToString
public static String DateToString(java.util.Date d)(Code)
converts date to a string in indian format
Parameters:
  Date - to be converted String in Indian Formatdiffers from the above in that it does not throw an exceptionthe date is considered to be valid since it is a util date



DateToTimeString
public static String DateToTimeString(java.util.Date d)(Code)



FriendlyDateStringToDate
public static java.util.Date FriendlyDateStringToDate(String d) throws ParseException(Code)
Converts a given date string to a date. A user may enter only a year, this would get converted to the first day of the year. User may enter only date, and the current month and year would be added. User may enter only date and month, and year would be added.



GenerateNewPassword
public static String GenerateNewPassword()(Code)



NextDateString
public static String NextDateString(java.util.Date base, int unit, int period)(Code)
int unit is Calendar.MONTH, YEAR or DATE int period is plus or minus months, days etc.



NextDay
public static int NextDay(java.util.Date base, int period)(Code)
returns the day part as int given a base date and how many day from base.



NextMonth
public static int NextMonth(java.util.Date base, int period)(Code)
returns the month part as int given a base date and how many month from base.



NextMonthString
public static String NextMonthString(java.util.Date base, int month)(Code)
returns (full date for) months after or before given date, if no date passed then current date used. int month can be negative or positive This can be used along with CurrentTimeString to give default dates in textboxes to user.



NextPeriod
public static int NextPeriod(java.util.Date base, int unit, int period)(Code)



NextYear
public static int NextYear(java.util.Date base, int period)(Code)
returns the year part as int given a base date and how many years from base.



NextYearString
public static String NextYearString(java.util.Date base, int year)(Code)
returns full date for years from the given date.
Parameters:
  year - int how man years from current +-.



NullToString
public static String NullToString(String astring)(Code)
if a string is null returns a blank else the string itself more for use in JSPs to cut down code.



OLDgetConnection
public static Connection OLDgetConnection()(Code)



SQLDateToDateString
public static String SQLDateToDateString(java.sql.Date d)(Code)
Converts a java.sql Date to a date string in Indian format



UtilDateToSQLDate
public static String UtilDateToSQLDate(java.util.Date UtilDate)(Code)



findFileInClassPath
public static String findFileInClassPath(String name)(Code)



isEmailValid
public static boolean isEmailValid(String text)(Code)
checks for existence of "at" and "dot" in email in that order.
Parameters:
  String - email true if valid, false if invalid



isNullString
public static boolean isNullString(String text)(Code)
Validates whether the input string is blank.
Parameters:
  text - String to be checked boolean is null true, is not null falseThe caller should use this method prior to validating a date or doing aparseInt



main
public static void main(String args)(Code)



printErrors
public static String printErrors(List errstr)(Code)



split
public static String[] split(String st, char sep)(Code)
splits a given string on given character separator returning an array of strings.
author:
   Rahul Kumar June 17, 2001
author:
   How to deal with consecutive delimiters - i am returning blank
author:
   strings.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.