-
Notifications
You must be signed in to change notification settings - Fork 19
/
Validation.java
45 lines (41 loc) · 1.01 KB
/
Validation.java
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
import java.sql.*;
import java.io.*;
public class Validation
{
public static void checkProperty(String strPropertyName, String strPropertyValue) throws SQLException
{
try
{
if (strPropertyValue == null)
throw new SQLException("Property Value for: " + strPropertyName + " not found!");
}
catch (Exception ex)
{
throw new SQLException(ex.getMessage());
}
}
public static void checkProperty(String intPropertyName, Integer intPropertyValue) throws SQLException
{
try
{
if (intPropertyValue == null)
throw new SQLException("Property Value for: " + intPropertyName + " not found!");
}
catch (Exception ex)
{
throw new SQLException(ex.getMessage());
}
}
public static void checkProperty(String booleanPropertyName, Boolean booleanPropertyValue) throws SQLException
{
try
{
if (booleanPropertyValue == null)
throw new SQLException("Property Value for: " + booleanPropertyName + " not found!");
}
catch (Exception ex)
{
throw new SQLException(ex.getMessage());
}
}
}