src/org/sonews/storage/impl/JDBCDatabase.java
changeset 44 5d7d1adf387f
parent 38 fdfc7225f799
child 45 7e24949b87b0
     1.1 --- a/src/org/sonews/storage/impl/JDBCDatabase.java	Tue Jun 07 09:23:34 2011 +0200
     1.2 +++ b/src/org/sonews/storage/impl/JDBCDatabase.java	Tue Jun 07 11:55:22 2011 +0200
     1.3 @@ -53,49 +53,49 @@
     1.4  {
     1.5  
     1.6  	public static final int MAX_RESTARTS = 2;
     1.7 -	private Connection conn = null;
     1.8 -	private PreparedStatement pstmtAddArticle1 = null;
     1.9 -	private PreparedStatement pstmtAddArticle2 = null;
    1.10 -	private PreparedStatement pstmtAddArticle3 = null;
    1.11 -	private PreparedStatement pstmtAddArticle4 = null;
    1.12 -	private PreparedStatement pstmtAddGroup0 = null;
    1.13 -	private PreparedStatement pstmtAddEvent = null;
    1.14 -	private PreparedStatement pstmtCountArticles = null;
    1.15 -	private PreparedStatement pstmtCountGroups = null;
    1.16 -	private PreparedStatement pstmtDeleteArticle0 = null;
    1.17 -	private PreparedStatement pstmtDeleteArticle1 = null;
    1.18 -	private PreparedStatement pstmtDeleteArticle2 = null;
    1.19 -	private PreparedStatement pstmtDeleteArticle3 = null;
    1.20 -	private PreparedStatement pstmtGetArticle0 = null;
    1.21 -	private PreparedStatement pstmtGetArticle1 = null;
    1.22 -	private PreparedStatement pstmtGetArticleHeaders0 = null;
    1.23 -	private PreparedStatement pstmtGetArticleHeaders1 = null;
    1.24 -	private PreparedStatement pstmtGetArticleHeads = null;
    1.25 -	private PreparedStatement pstmtGetArticleIDs = null;
    1.26 -	private PreparedStatement pstmtGetArticleIndex = null;
    1.27 -	private PreparedStatement pstmtGetConfigValue = null;
    1.28 -	private PreparedStatement pstmtGetEventsCount0 = null;
    1.29 -	private PreparedStatement pstmtGetEventsCount1 = null;
    1.30 -	private PreparedStatement pstmtGetGroupForList = null;
    1.31 -	private PreparedStatement pstmtGetGroup0 = null;
    1.32 -	private PreparedStatement pstmtGetGroup1 = null;
    1.33 -	private PreparedStatement pstmtGetFirstArticleNumber = null;
    1.34 -	private PreparedStatement pstmtGetListForGroup = null;
    1.35 -	private PreparedStatement pstmtGetLastArticleNumber = null;
    1.36 -	private PreparedStatement pstmtGetMaxArticleID = null;
    1.37 -	private PreparedStatement pstmtGetMaxArticleIndex = null;
    1.38 -	private PreparedStatement pstmtGetOldestArticle = null;
    1.39 -	private PreparedStatement pstmtGetPostingsCount = null;
    1.40 -	private PreparedStatement pstmtGetSubscriptions = null;
    1.41 -	private PreparedStatement pstmtIsArticleExisting = null;
    1.42 -	private PreparedStatement pstmtIsGroupExisting = null;
    1.43 -	private PreparedStatement pstmtPurgeGroup0 = null;
    1.44 -	private PreparedStatement pstmtPurgeGroup1 = null;
    1.45 -	private PreparedStatement pstmtSetConfigValue0 = null;
    1.46 -	private PreparedStatement pstmtSetConfigValue1 = null;
    1.47 -	private PreparedStatement pstmtUpdateGroup = null;
    1.48 +	protected Connection conn = null;
    1.49 +	protected PreparedStatement pstmtAddArticle1 = null;
    1.50 +	protected PreparedStatement pstmtAddArticle2 = null;
    1.51 +	protected PreparedStatement pstmtAddArticle3 = null;
    1.52 +	protected PreparedStatement pstmtAddArticle4 = null;
    1.53 +	protected PreparedStatement pstmtAddGroup0 = null;
    1.54 +	protected PreparedStatement pstmtAddEvent = null;
    1.55 +	protected PreparedStatement pstmtCountArticles = null;
    1.56 +	protected PreparedStatement pstmtCountGroups = null;
    1.57 +	protected PreparedStatement pstmtDeleteArticle0 = null;
    1.58 +	protected PreparedStatement pstmtDeleteArticle1 = null;
    1.59 +	protected PreparedStatement pstmtDeleteArticle2 = null;
    1.60 +	protected PreparedStatement pstmtDeleteArticle3 = null;
    1.61 +	protected PreparedStatement pstmtGetArticle0 = null;
    1.62 +	protected PreparedStatement pstmtGetArticle1 = null;
    1.63 +	protected PreparedStatement pstmtGetArticleHeaders0 = null;
    1.64 +	protected PreparedStatement pstmtGetArticleHeaders1 = null;
    1.65 +	protected PreparedStatement pstmtGetArticleHeads = null;
    1.66 +	protected PreparedStatement pstmtGetArticleIDs = null;
    1.67 +	protected PreparedStatement pstmtGetArticleIndex = null;
    1.68 +	protected PreparedStatement pstmtGetConfigValue = null;
    1.69 +	protected PreparedStatement pstmtGetEventsCount0 = null;
    1.70 +	protected PreparedStatement pstmtGetEventsCount1 = null;
    1.71 +	protected PreparedStatement pstmtGetGroupForList = null;
    1.72 +	protected PreparedStatement pstmtGetGroup0 = null;
    1.73 +	protected PreparedStatement pstmtGetGroup1 = null;
    1.74 +	protected PreparedStatement pstmtGetFirstArticleNumber = null;
    1.75 +	protected PreparedStatement pstmtGetListForGroup = null;
    1.76 +	protected PreparedStatement pstmtGetLastArticleNumber = null;
    1.77 +	protected PreparedStatement pstmtGetMaxArticleID = null;
    1.78 +	protected PreparedStatement pstmtGetMaxArticleIndex = null;
    1.79 +	protected PreparedStatement pstmtGetOldestArticle = null;
    1.80 +	protected PreparedStatement pstmtGetPostingsCount = null;
    1.81 +	protected PreparedStatement pstmtGetSubscriptions = null;
    1.82 +	protected PreparedStatement pstmtIsArticleExisting = null;
    1.83 +	protected PreparedStatement pstmtIsGroupExisting = null;
    1.84 +	protected PreparedStatement pstmtPurgeGroup0 = null;
    1.85 +	protected PreparedStatement pstmtPurgeGroup1 = null;
    1.86 +	protected PreparedStatement pstmtSetConfigValue0 = null;
    1.87 +	protected PreparedStatement pstmtSetConfigValue1 = null;
    1.88 +	protected PreparedStatement pstmtUpdateGroup = null;
    1.89  	/** How many times the database connection was reinitialized */
    1.90 -	private int restarts = 0;
    1.91 +	protected int restarts = 0;
    1.92  
    1.93  	/**
    1.94  	 * Rises the database: reconnect and recreate all prepared statements.