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

nyla.solutions.dao.jdbc.mapping.ObjectArrayPreparedStatementConstructor Maven / Gradle / Ivy

package nyla.solutions.dao.jdbc.mapping;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import nyla.solutions.dao.PreparedStatementConstructor;

/**
 * Set prepared statement with arguments for object array
 * @author Gregory Green
 *
 */
public class ObjectArrayPreparedStatementConstructor implements
		PreparedStatementConstructor
{

	public void constructPreparedStatement(Connection connection,
			PreparedStatement preparedStatement, Object[] objs)
			throws SQLException
	{
		if(objs == null || objs.length == 0)
			return;
		
		for (int i = 0; i < objs.length; i++)
		{
			preparedStatement.setObject(i+1, objs[i]);	
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy