All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cds.jdbc.sqlite.SqliteExceptionAnalyzer Maven / Gradle / Ivy

The newest version!
/*******************************************************************
 * © 2021 SAP SE or an SAP affiliate company. All rights reserved. *
 *******************************************************************/
package com.sap.cds.jdbc.sqlite;

import java.sql.SQLException;

import com.sap.cds.jdbc.spi.ExceptionAnalyzer;

public class SqliteExceptionAnalyzer implements ExceptionAnalyzer {

	@Override
	public boolean isUniqueConstraint(SQLException ex) {
		return ex.getErrorCode() == 19 && ex.getMessage().contains("UNIQUE constraint failed");
	}

	@Override
	public boolean isNotNullConstraint(SQLException ex) {
		return ex.getErrorCode() == 19 && ex.getMessage().contains("NOT NULL constraint failed");
	}

	@Override
	public boolean isLockTimeout(SQLException ex) {
		return false;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy