summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc2/PBatchUpdateException.java
blob: 2f9d8ee40218c4c68cf13e89a307ad2de23b78af (plain)
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
package org.postgresql.jdbc2;

import org.postgresql.util.*;
import java.sql.*;

/**
 * This class extends java.sql.BatchUpdateException, and provides our 
 * internationalisation handling.
 */
class PBatchUpdateException extends java.sql.BatchUpdateException {

	private String message;

	public PBatchUpdateException(
		String error, Object arg1, Object arg2, int[] updateCounts ) {

		super(updateCounts);

		Object[] argv = new Object[2];
		argv[0] = arg1;
		argv[1] = arg2;
		translate(error,argv);
	}

	private void translate(String error, Object[] args) {
		message = MessageTranslator.translate(error,args);
	}

	// Overides Throwable
	public String getLocalizedMessage()
	{
		return message;
	}

    // Overides Throwable
	public String getMessage()
	{
		return message;
	}

	// Overides Object
	public String toString()
	{
	    return message;
	}
}