1 9 package com.ziclix.python.sql; 10 11 import org.python.core.PyObject; 12 13 import java.sql.PreparedStatement ; 14 import java.sql.SQLException ; 15 import java.sql.ParameterMetaData ; 16 17 24 public class JDBC30DataHandler extends FilterDataHandler { 25 26 static { 27 try { 28 Class.forName("java.sql.ParameterMetaData"); 29 } catch (ClassNotFoundException e) { 30 throw new RuntimeException ("JDBC3.0 required to use this DataHandler"); 31 } 32 } 33 34 38 public JDBC30DataHandler(DataHandler datahandler) { 39 super(datahandler); 40 } 41 42 51 public void setJDBCObject(PreparedStatement stmt, int index, PyObject object) throws SQLException { 52 ParameterMetaData meta = stmt.getParameterMetaData(); 53 super.setJDBCObject(stmt, index, object, meta.getParameterType(index)); 54 } 55 } 56 57 | Popular Tags |