From: Viktor M. <mih...@us...> - 2005-06-03 10:32:11
|
Update of /cvsroot/sblim/sfcb/jdbc/com/ibm/wbem/jdbc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13949/jdbc/com/ibm/wbem/jdbc Added Files: CIMCallableStatement.java CIMConnection.java CIMDatabaseMetaData.java CIMDriver.java CIMPreparedStatement.java CIMResultSet.java CIMResultSetMetaData.java CIMStatement.java Log Message: Bug fixed 1214077: Added SQL Support (for JDBC). --- NEW FILE: CIMConnection.java --- /* * Created on 16.02.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.ibm.wbem.jdbc; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.SQLWarning; import java.sql.Savepoint; import java.sql.Statement; import java.util.Map; import java.util.Properties; /** * @author seyrich * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class CIMConnection implements Connection{ private BufferedReader in; private PrintWriter out; private Socket s; private String catalog; private boolean readOnly; private DatabaseMetaData dbMeta; private SQLWarning sqlWarnings; public CIMConnection(Socket s) throws IOException{ this.s = s; in = new BufferedReader(new InputStreamReader(s.getInputStream())); out = new PrintWriter(s.getOutputStream()); out.println("1 1 ");out.flush(); if(!in.readLine().equals("1 1 1")) s=null; } /* (non-Javadoc) * @see java.sql.Connection#getHoldability() */ public int getHoldability() throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: getHoldability()"); //return 0; } /* (non-Javadoc) * @see java.sql.Connection#getTransactionIsolation() */ public int getTransactionIsolation() throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: getTransactionIsolation()"); //return 0; } /* (non-Javadoc) * @see java.sql.Connection#clearWarnings() */ public void clearWarnings() throws SQLException { // TODO Auto-generated method stub sqlWarnings = null; } /* (non-Javadoc) * @see java.sql.Connection#close() */ public void close() throws SQLException { System.out.println("close()"); if(s==null) return; out.println("1 2\n");out.flush(); System.out.println("1 2 gesendet"); try { in.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } out.close(); try { s.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } /* (non-Javadoc) * @see java.sql.Connection#commit() */ public void commit() throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: commit()"); } /* (non-Javadoc) * @see java.sql.Connection#rollback() */ public void rollback() throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: rollback()"); } /* (non-Javadoc) * @see java.sql.Connection#getAutoCommit() */ public boolean getAutoCommit() throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: getAutoCommit()"); //return false; } /* (non-Javadoc) * @see java.sql.Connection#isClosed() */ public boolean isClosed() throws SQLException { return s==null||s.isClosed(); } /* (non-Javadoc) * @see java.sql.Connection#isReadOnly() */ public boolean isReadOnly() throws SQLException { // TODO Auto-generated method stub return readOnly; } /* (non-Javadoc) * @see java.sql.Connection#setHoldability(int) */ public void setHoldability(int arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: setHoldability()"); } /* (non-Javadoc) * @see java.sql.Connection#setTransactionIsolation(int) */ public void setTransactionIsolation(int arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: setTransactionIsolation()"); } /* (non-Javadoc) * @see java.sql.Connection#setAutoCommit(boolean) */ public void setAutoCommit(boolean arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: setAutoCommit()"); } /* (non-Javadoc) * @see java.sql.Connection#setReadOnly(boolean) */ public void setReadOnly(boolean arg0) throws SQLException { //sollte an die DB weitergegeben werden. Dmit auch in Selects keine Funktionen mit Seiteneffekten aufgerufen werden können readOnly = arg0; } /* (non-Javadoc) * @see java.sql.Connection#getCatalog() */ public String getCatalog() throws SQLException { return catalog; } /* (non-Javadoc) * @see java.sql.Connection#setCatalog(java.lang.String) */ public void setCatalog(String arg0) throws SQLException { catalog = arg0; } /* (non-Javadoc) * @see java.sql.Connection#getMetaData() */ public DatabaseMetaData getMetaData() throws SQLException { //diese Daten müssen einmalig erhoben werden. Allerdings //nicht im Konstruktor, da die Daten nicht bei jeder Connection //vom Client angefordert werden if(dbMeta==null){ out.println("3 1 ");out.flush(); String inString=null; try { if(in.readLine().equals("3 1 1")){ do{ inString += in.readLine(); }while(!inString.endsWith("$$")); Properties prop = new Properties(); inString = inString.substring(0,inString.length()-2); String[] s = inString.split(";"); for(int i=0; i<s.length;i++){ String[] t = s[i].split("="); prop.setProperty(t[0],t[1]); } dbMeta = new CIMDatabaseMetaData(prop,this.s,this,in,out); } else System.out.println("Fehler "); //Parameterliste empfangen //DatabaseMetaData erzeugen mit Liste als Argument. } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); throw new SQLException("IOException reading Socket"); } } return dbMeta; } /* (non-Javadoc) * @see java.sql.Connection#getWarnings() */ public SQLWarning getWarnings() throws SQLException { return sqlWarnings; } /* (non-Javadoc) * @see java.sql.Connection#setSavepoint() */ public Savepoint setSavepoint() throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: setSavepoint()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#releaseSavepoint(java.sql.Savepoint) */ public void releaseSavepoint(Savepoint arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: releaseSavepoint()"); } /* (non-Javadoc) * @see java.sql.Connection#rollback(java.sql.Savepoint) */ public void rollback(Savepoint arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: rollback()"); } /* (non-Javadoc) * @see java.sql.Connection#createStatement() */ public Statement createStatement() throws SQLException { return new CIMStatement(s,this); } /* (non-Javadoc) * @see java.sql.Connection#createStatement(int, int) */ public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { throw new SQLException("Not Implemented: createStatement(int resultSetType, int resultSetConcurrency)"); } /* (non-Javadoc) * @see java.sql.Connection#createStatement(int, int, int) */ public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { throw new SQLException("Not Implemented: createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)"); } /* (non-Javadoc) * @see java.sql.Connection#getTypeMap() */ public Map getTypeMap() throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: getTypeMap()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#setTypeMap(java.util.Map) */ public void setTypeMap(Map arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: setTypeMap()"); } /* (non-Javadoc) * @see java.sql.Connection#nativeSQL(java.lang.String) */ public String nativeSQL(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: nativeSQL()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#prepareCall(java.lang.String) */ public CallableStatement prepareCall(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: prepareCall()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#prepareCall(java.lang.String, int, int) */ public CallableStatement prepareCall(String arg0, int arg1, int arg2) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: prepareCall()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#prepareCall(java.lang.String, int, int, int) */ public CallableStatement prepareCall(String arg0, int arg1, int arg2, int arg3) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: prepareCall()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#prepareStatement(java.lang.String) */ public PreparedStatement prepareStatement(String sql) throws SQLException { // TODO Auto-generated method stub return new CIMPreparedStatement(s,this,sql); } /* (non-Javadoc) * @see java.sql.Connection#prepareStatement(java.lang.String, int) */ public PreparedStatement prepareStatement(String arg0, int arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: prepareStatement()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#prepareStatement(java.lang.String, int, int) */ public PreparedStatement prepareStatement(String arg0, int arg1, int arg2) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: prepareStatement()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#prepareStatement(java.lang.String, int, int, int) */ public PreparedStatement prepareStatement(String arg0, int arg1, int arg2, int arg3) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: prepareStatement()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#prepareStatement(java.lang.String, int[]) */ public PreparedStatement prepareStatement(String arg0, int[] arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: prepareStatement()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#setSavepoint(java.lang.String) */ public Savepoint setSavepoint(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: setSavepoint()"); //return null; } /* (non-Javadoc) * @see java.sql.Connection#prepareStatement(java.lang.String, java.lang.String[]) */ public PreparedStatement prepareStatement(String arg0, String[] arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: prepareStatement()"); //return null; } } --- NEW FILE: CIMResultSetMetaData.java --- /* * Created on 16.02.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.ibm.wbem.jdbc; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Types; /** * @author seyrich * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class CIMResultSetMetaData implements ResultSetMetaData { private String[][] col; private ResultSetMetaData rsmd; /** * @param prop */ public CIMResultSetMetaData(String prop) { String[] st = prop.split("::"); col = new String[st.length][]; for (int i = 0; i < col.length; i++) { col[i] = st[i].split(";"); } //für getColumnDisplaySize() } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getColumnCount() */ public int getColumnCount() throws SQLException { return col.length; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getColumnDisplaySize(int) */ public int getColumnDisplaySize(int column) throws SQLException { //Es wird nach der Anzahl der ZEICHEN gefragt! int indx = col[column][2].indexOf("(")>0? col[column][2].indexOf("("):col[column][2].length(); String s = col[column][2].toUpperCase().substring(0,indx); if(s.equals("BIGINT")) return -1;//Nachschlage --> CIMOM else if(s.equals("TIMESTAMP")) return -1;//Nachschlage --> CIMOM else if(s.equals("DATE")) return -1;//Nachschlage --> CIMOM else if(s.equals("VARCHAR")){ return Integer.parseInt(col[column][2].substring(col[column][2].indexOf("(")+1,col[column][2].length()-1)); } else if(s.equals("CHAR")) return -1;//Nachschlage --> CIMOM else if(s.equals("DECIMAL") || s.equals("NUMERIC") || s.equals("NUM") || s.equals("DEC")){ //das +1 muss sein, wegen des "," in der Darstellung return Integer.parseInt(col[column][2].substring(col[column][2].indexOf("(")+1,col[column][2].indexOf(",")))+1; } else if(s.equals("DOUBLE")) return -1;//Nachschlage --> CIMOM else if(s.equals("REAL")) return -1;//Nachschlage --> CIMOM else if(s.equals("INTEGER")) return -1;//Nachschlage --> CIMOM else if(s.equals("INT")) return -1;//Nachschlage --> CIMOM else if(s.equals("SMALLINT")) return -1;//Nachschlage --> CIMOM else return 0; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getColumnType(int) */ public int getColumnType(int column) throws SQLException { int indx = col[column][2].indexOf("(")>0? col[column][2].indexOf("("):col[column][2].length(); String s = col[column][2].toUpperCase().substring(0,indx); if(s.equals("BIGINT")) return Types.BIGINT; if(s.equals("TIMESTAMP")) return Types.TIMESTAMP; if(s.equals("DATE")) return Types.DATE; if(s.equals("VARCHAR")) return Types.VARCHAR; if(s.equals("CHAR")) return Types.CHAR; if(s.equals("DECIMAL")) return Types.DECIMAL; if(s.equals("NUMERIC")) return Types.DECIMAL; if(s.equals("NUM")) return Types.DECIMAL; if(s.equals("DEC")) return Types.DECIMAL; if(s.equals("DOUBLE")) return Types.DOUBLE; if(s.equals("REAL")) return Types.REAL; if(s.equals("INTEGER")) return Types.INTEGER; if(s.equals("INT")) return Types.INTEGER; if(s.equals("SMALLINT")) return Types.SMALLINT; if(s.equals("BOOLEAN")) return Types.BOOLEAN; if(s.equals("REF")) return Types.REF; if(s.equals("OTHER")) return Types.OTHER; //System.out.println(s); throw new SQLException(); } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getPrecision(int) */ public int getPrecision(int column) throws SQLException { if(getColumnType(column)==Types.DECIMAL) return Integer.parseInt(col[column][2].substring(col[column][2].indexOf("(")+1,col[column][2].indexOf(","))); return 0; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getScale(int) */ public int getScale(int column) throws SQLException { if(getColumnType(column)==Types.DECIMAL) return Integer.parseInt(col[column][2].substring(col[column][2].indexOf(",")+1,col[column][2].indexOf(")"))); return 0; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isNullable(int) */ public int isNullable(int column) throws SQLException { // TODO Auto-generated method stub return Integer.parseInt(col[column][4]); } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isAutoIncrement(int) */ public boolean isAutoIncrement(int arg0) throws SQLException { return false; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isCaseSensitive(int) */ public boolean isCaseSensitive(int column) throws SQLException { return col[column][5].equalsIgnoreCase("true"); } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isCurrency(int) */ public boolean isCurrency(int arg0) throws SQLException { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isDefinitelyWritable(int) */ public boolean isDefinitelyWritable(int column) throws SQLException { return col[column][3].equalsIgnoreCase("true"); } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isReadOnly(int) */ public boolean isReadOnly(int column) throws SQLException { return !isDefinitelyWritable(column); } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isSearchable(int) */ public boolean isSearchable(int arg0) throws SQLException { return true; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isSigned(int) */ public boolean isSigned(int arg0) throws SQLException { return true; //MIT CIMOM-DT ABGLEICHEN } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#isWritable(int) */ public boolean isWritable(int column) throws SQLException { return isDefinitelyWritable(column); } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getCatalogName(int) */ public String getCatalogName(int arg0) throws SQLException { throw new SQLException("Catalog not supported"); } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getColumnClassName(int) */ public String getColumnClassName(int column) throws SQLException { // Synchron zu CIMResultSetMetaData.getColumnClassName() halten //System.out.println(column); switch(getColumnType(column)){ case Types.BIGINT: return "java.math.BigInteger"; case Types.TIMESTAMP: return "java.sql.Timestamp"; case Types.DATE: return "java.lang.Long"; case Types.VARCHAR: return "java.lang.String"; case Types.CHAR: return "java.lang.String"; case Types.DECIMAL: return "java.math.BigDecimal"; case Types.DOUBLE: return "java.lang.Double"; case Types.REAL: return "java.lang.Float"; case Types.INTEGER: return "java.lang.Integer"; case Types.SMALLINT: return "java.lang.Integer"; case Types.NULL: return "null"; case Types.BOOLEAN: return "java.lang.Boolean"; case Types.REF: return "java.lang.String"; case Types.OTHER: return "java.lang.String"; default: throw new SQLException(); } } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getColumnLabel(int) */ public String getColumnLabel(int column) throws SQLException { return col[column][1]; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getColumnName(int) */ public String getColumnName(int column) throws SQLException { return col[column][1]; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getColumnTypeName(int) */ public String getColumnTypeName(int column) throws SQLException { return col[column][2]; } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getSchemaName(int) */ public String getSchemaName(int column) throws SQLException { throw new SQLException("Schema not supported"); } /* (non-Javadoc) * @see java.sql.ResultSetMetaData#getTableName(int) */ public String getTableName(int column) throws SQLException { return col[column][0]; } } --- NEW FILE: CIMDriver.java --- /* * Created on 16.02.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.ibm.wbem.jdbc; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverPropertyInfo; import java.sql.SQLException; import java.util.Properties; /** * @author seyrich * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class CIMDriver implements Driver { public static final int VERSION = 0; public static final String NAME = "CIM-JDBC for sfcb"; public static final String VERSIONSTRING = "V 0.1"; /** * Driver will be registered on class loading */ static { try { java.sql.DriverManager.registerDriver(new CIMDriver()); } catch (SQLException e) { throw new RuntimeException("CIM-Driver: Can't register driver!"); } } public CIMDriver() throws SQLException{ System.out.println("Driver-Konstruktor"); } /* (non-Javadoc) * @see java.sql.Driver#getMajorVersion() */ public int getMajorVersion() { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.Driver#getMinorVersion() */ public int getMinorVersion() { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.Driver#jdbcCompliant() */ public boolean jdbcCompliant() { // TODO Auto-generated method stub return false; } /* * @see java.sql.Driver#acceptsURL(java.lang.String) * arg0: <ip-adresse>[:port] */ public boolean acceptsURL(String arg0) throws SQLException { boolean acc = false; try { Socket s = getConSocket(arg0); BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter out = new PrintWriter(s.getOutputStream()); out.println("1 1 ");out.flush(); acc = in.readLine().equals("1 1 1"); out.println("1 2\n");out.flush(); in.close();out.close();s.close(); } catch (UnknownHostException e) { throw new SQLException("UnkownHost: "+arg0); } catch (IOException e) { throw new SQLException(); } catch (NumberFormatException e){ throw new SQLException("Cannot parse String to int\n"+e.toString()); } return acc; } private Socket getConSocket(String url) throws UnknownHostException, IOException, NumberFormatException{ int c, port; String addr; if((c=url.indexOf(":"))>0){ addr = url.substring(0,c); port = Integer.parseInt(url.substring(c+1,url.length())); } else{ port = 5980; addr = url; } InetAddress serveraddr = InetAddress.getByName(addr); return new Socket(serveraddr, port); } /* (non-Javadoc) * @see java.sql.Driver#connect(java.lang.String, java.util.Properties) */ public Connection connect(String arg0, Properties arg1) throws SQLException { Socket s = null; try { s = getConSocket(arg0); return new CIMConnection(s); } catch (UnknownHostException e) { throw new SQLException(); } catch (IOException e) { throw new SQLException(); } catch (NumberFormatException e){ throw new SQLException(); } } /* (non-Javadoc) * @see java.sql.Driver#getPropertyInfo(java.lang.String, java.util.Properties) */ public DriverPropertyInfo[] getPropertyInfo(String arg0, Properties arg1) throws SQLException { // TODO Auto-generated method stub return null; } public static void main(String[] args){ try { System.out.println((new CIMDriver().acceptsURL("127.0.0.1:5980"))); Connection con = new CIMDriver().connect("127.0.0.1:5980",null); con.getMetaData(); con.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } String a = "varchar(4987)"; System.out.println(a.substring(a.indexOf("(")+1,a.length()-1)); System.out.println(a.toUpperCase().substring(0,a.indexOf("("))); a = "dec(13,2)"; System.out.println(""+(Integer.parseInt(a.substring(a.indexOf("(")+1,a.indexOf(",")))+1)); System.out.println(""+(Integer.parseInt(a.substring(a.indexOf(",")+1,a.indexOf(")"))))); } } --- NEW FILE: CIMDatabaseMetaData.java --- /* * Created on 16.02.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.ibm.wbem.jdbc; import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; import java.net.Socket; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLWarning; import java.util.Properties; [...1343 lines suppressed...] } /* (non-Javadoc) * @see java.sql.DatabaseMetaData#getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) */ public ResultSet getTables(String catalog, String schemapattern, String tableNamePattern, String[] types) throws SQLException { return execute(tableNamePattern,"3 2"); } /* (non-Javadoc) * @see java.sql.DatabaseMetaData#getCrossReference(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ public ResultSet getCrossReference(String arg0, String arg1, String arg2, String arg3, String arg4, String arg5) throws SQLException { // TODO Auto-generated method stub return null; } } --- NEW FILE: CIMResultSet.java --- /* * Created on 16.02.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.ibm.wbem.jdbc; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.Reader; import java.math.BigDecimal; import java.math.BigInteger; import java.net.Socket; import java.net.URL; import java.sql.Array; [...1234 lines suppressed...] */ public Date getDate(String arg0, Calendar arg1) throws SQLException { throw new SQLException("Not Implemented: ResultSet()"); } /* (non-Javadoc) * @see java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar) */ public Time getTime(String arg0, Calendar arg1) throws SQLException { throw new SQLException("Not Implemented: ResultSet()"); } /* (non-Javadoc) * @see java.sql.ResultSet#getTimestamp(java.lang.String, java.util.Calendar) */ public Timestamp getTimestamp(String arg0, Calendar arg1) throws SQLException { throw new SQLException("Not Implemented: ResultSet()"); } } --- NEW FILE: CIMStatement.java --- /* * Created on 16.02.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.ibm.wbem.jdbc; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLWarning; import java.sql.Statement; /** * @author seyrich * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class CIMStatement implements Statement { private Socket s; private BufferedReader in; private PrintWriter out; private CIMConnection con; private ResultSet rs; private SQLWarning sw; private int fetchDir; private int maxFieldSize = 0; private int maxRows = 0; private int fetchSize = 0; /** * @param s * @param connectio * @throws SQLException */ public CIMStatement(Socket s, CIMConnection con) throws SQLException { this.s = s; this.con = con; try { in = new BufferedReader(new InputStreamReader(s.getInputStream())); out = new PrintWriter(s.getOutputStream()); } catch (IOException e) { throw new SQLException(); } fetchDir = ResultSet.FETCH_FORWARD; } /** * @param s2 * @param connection */ /* (non-Javadoc) * @see java.sql.Statement#getFetchDirection() */ public int getFetchDirection() throws SQLException { return fetchDir; } /* (non-Javadoc) * @see java.sql.Statement#getFetchSize() */ public int getFetchSize() throws SQLException { return fetchSize;//no limit } /* (non-Javadoc) * @see java.sql.Statement#getMaxFieldSize() */ public int getMaxFieldSize() throws SQLException { return maxFieldSize;//no limit } /* (non-Javadoc) * @see java.sql.Statement#getMaxRows() */ public int getMaxRows() throws SQLException { return maxRows;//no limit } /* (non-Javadoc) * @see java.sql.Statement#getQueryTimeout() */ public int getQueryTimeout() throws SQLException { // TODO Auto-generated method stub return 0;//no limit } /* (non-Javadoc) * @see java.sql.Statement#getResultSetConcurrency() */ public int getResultSetConcurrency() throws SQLException { return ResultSet.CONCUR_READ_ONLY; } /* (non-Javadoc) * @see java.sql.Statement#getResultSetHoldability() */ public int getResultSetHoldability() throws SQLException { throw new SQLException("Not Implemented: Statement()");//commit not spported } /* (non-Javadoc) * @see java.sql.Statement#getResultSetType() */ public int getResultSetType() throws SQLException { return ResultSet.TYPE_SCROLL_INSENSITIVE; } /* (non-Javadoc) * @see java.sql.Statement#getUpdateCount() */ public int getUpdateCount() throws SQLException { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.Statement#cancel() */ public void cancel() throws SQLException { //beide muessten das unterstuetzen. jdbc und cimom!! throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.Statement#clearBatch() */ public void clearBatch() throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.Statement#clearWarnings() */ public void clearWarnings() throws SQLException { // nothing to do... } /* (non-Javadoc) * @see java.sql.Statement#close() */ public void close() throws SQLException { //Pipe darf nicht closed werden, sonst ist der ganze Socket tot! rs = null; sw = null; } /* (non-Javadoc) * @see java.sql.Statement#getMoreResults() */ public boolean getMoreResults() throws SQLException { return false; } /* (non-Javadoc) * @see java.sql.Statement#executeBatch() */ public int[] executeBatch() throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#setFetchDirection(int) */ public void setFetchDirection(int dir) throws SQLException { fetchDir = dir; } /* (non-Javadoc) * @see java.sql.Statement#setFetchSize(int) */ public void setFetchSize(int arg0) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#setMaxFieldSize(int) */ public void setMaxFieldSize(int size) throws SQLException { maxFieldSize = size; } /* (non-Javadoc) * @see java.sql.Statement#setMaxRows(int) */ public void setMaxRows(int maxRows) throws SQLException { this.maxRows = maxRows; } /* (non-Javadoc) * @see java.sql.Statement#setQueryTimeout(int) */ public void setQueryTimeout(int arg0) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#getMoreResults(int) */ public boolean getMoreResults(int arg0) throws SQLException { return false; } /* (non-Javadoc) * @see java.sql.Statement#setEscapeProcessing(boolean) */ public void setEscapeProcessing(boolean arg0) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#executeUpdate(java.lang.String) */ public int executeUpdate(String arg0) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#addBatch(java.lang.String) */ public void addBatch(String arg0) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#setCursorName(java.lang.String) */ public void setCursorName(String arg0) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#execute(java.lang.String) */ public boolean execute(String sql) throws SQLException { try { rs = executeQuery(sql); return true; } catch (Exception e) { return false; } } /* (non-Javadoc) * @see java.sql.Statement#executeUpdate(java.lang.String, int) */ public int executeUpdate(String arg0, int arg1) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#execute(java.lang.String, int) */ public boolean execute(String arg0, int arg1) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#executeUpdate(java.lang.String, int[]) */ public int executeUpdate(String arg0, int[] arg1) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#execute(java.lang.String, int[]) */ public boolean execute(String arg0, int[] arg1) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#getConnection() */ public Connection getConnection() throws SQLException { return con; } /* (non-Javadoc) * @see java.sql.Statement#getGeneratedKeys() */ public ResultSet getGeneratedKeys() throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#getResultSet() */ public ResultSet getResultSet() throws SQLException { // TODO Auto-generated method stub return rs; } /* (non-Javadoc) * @see java.sql.Statement#getWarnings() */ public SQLWarning getWarnings() throws SQLException { return sw; } /* (non-Javadoc) * @see java.sql.Statement#executeUpdate(java.lang.String, java.lang.String[]) */ public int executeUpdate(String arg0, String[] arg1) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#execute(java.lang.String, java.lang.String[]) */ public boolean execute(String arg0, String[] arg1) throws SQLException { throw new SQLException("Not Implemented: Statement()"); } /* (non-Javadoc) * @see java.sql.Statement#executeQuery(java.lang.String) */ public ResultSet executeQuery(String sql) throws SQLException { sw = null;rs = null; //Anfrage abschicken out.println("2 "+sql+"$");out.flush(); String inString=""; try { //Antwort abwarten und analysieren //Fehler String protocollSt=in.readLine(); boolean first = true; do{ if(!first) inString += "\n"+in.readLine(); else{ inString += in.readLine(); first = false; } }while(!inString.endsWith("$$")); System.out.println(protocollSt+"<<<\n"+inString); inString = inString.substring(0,inString.length()-2); String w[] = inString.split(";"); sw = new SQLWarning(w[1],w[0]); if(!protocollSt.equals("2 1")){ System.out.println("2 0: "+protocollSt); throw sw; } else{ //System.out.println("2 1 "+inString); //Warning einlesen } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); throw new SQLException("IOException reading Socket"); } rs = new CIMResultSet(s,this,in,out); return rs; } protected BufferedReader getIn() { return in; } protected PrintWriter getOut() { return out; } } --- NEW FILE: CIMPreparedStatement.java --- /* * Created on 16.02.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.ibm.wbem.jdbc; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.Socket; import java.net.URL; import java.sql.Array; import java.sql.Blob; import java.sql.Clob; import java.sql.Date; import java.sql.ParameterMetaData; import java.sql.PreparedStatement; import java.sql.Ref; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Time; import java.sql.Timestamp; import java.sql.Types; import java.util.Calendar; /** * @author seyrich * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class CIMPreparedStatement extends CIMStatement implements PreparedStatement{ private String sql; protected String[] values; /** * @param connection * @param s * @param arg0 */ public CIMPreparedStatement(Socket s, CIMConnection connection, String sql) throws SQLException{ super(s,connection); this.sql = sql; char c[] = sql.toCharArray(); int count = 0; for (int i = 0; i < c.length; i++) { if(c[i]=='?') count++; } values = new String[count]; } /* (non-Javadoc) * @see java.sql.PreparedStatement#executeUpdate() */ public int executeUpdate() throws SQLException { return super.executeUpdate(formatSQL()); } public String toString(){ try { return formatSQL(); } catch (Exception e) { return e.toString(); } } /** * @return */ private String formatSQL() throws SQLException { String res = sql; System.out.println(sql); for (int i = 0; i < values.length; i++) { if(values[i]==null) throw new SQLException(i+". value is not set"); System.out.println(values[i]); res = res.replaceFirst("\\?",values[i]); } return res; } /* (non-Javadoc) * @see java.sql.PreparedStatement#addBatch() */ public void addBatch() throws SQLException { throw new SQLException("Not Implemented: CallableStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#clearParameters() */ public void clearParameters() throws SQLException { for (int i = 0; i < values.length; i++) { values[i]=null; } } /* (non-Javadoc) * @see java.sql.PreparedStatement#execute() */ public boolean execute() throws SQLException { return super.execute(formatSQL()); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setByte(int, byte) */ public void setByte(int parameterIndex, byte arg1) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setDouble(int, double) */ public void setDouble(int parameterIndex, double val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val+""; } /* (non-Javadoc) * @see java.sql.PreparedStatement#setFloat(int, float) */ public void setFloat(int parameterIndex, float val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val+""; } /* (non-Javadoc) * @see java.sql.PreparedStatement#setInt(int, int) */ public void setInt(int parameterIndex, int val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val+""; } /* (non-Javadoc) * @see java.sql.PreparedStatement#setNull(int, int) */ public void setNull(int parameterIndex, int val) throws SQLException { if(Types.NULL!=val) throw new SQLException(val+" doesn't identify a null value"); values[parameterIndex-1] = "NULL"; } /* (non-Javadoc) * @see java.sql.PreparedStatement#setLong(int, long) */ public void setLong(int parameterIndex, long val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val+""; } /* (non-Javadoc) * @see java.sql.PreparedStatement#setShort(int, short) */ public void setShort(int parameterIndex, short val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val+""; } /* (non-Javadoc) * @see java.sql.PreparedStatement#setBoolean(int, boolean) */ public void setBoolean(int parameterIndex, boolean val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val ? "true":"false"; } /* (non-Javadoc) * @see java.sql.PreparedStatement#setBytes(int, byte[]) */ public void setBytes(int parameterIndex, byte[] val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = new String(val); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream, int) */ public void setAsciiStream(int parameterIndex, InputStream arg1, int arg2) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream, int) */ public void setBinaryStream(int parameterIndex, InputStream arg1, int arg2) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setUnicodeStream(int, java.io.InputStream, int) */ public void setUnicodeStream(int parameterIndex, InputStream arg1, int arg2) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader, int) */ public void setCharacterStream(int parameterIndex, Reader arg1, int arg2) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setObject(int, java.lang.Object) */ public void setObject(int parameterIndex, Object val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val.toString(); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setObject(int, java.lang.Object, int) */ public void setObject(int parameterIndex, Object arg1, int arg2) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setObject(int, java.lang.Object, int, int) */ public void setObject(int parameterIndex, Object arg1, int arg2, int arg3) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setNull(int, int, java.lang.String) */ public void setNull(int parameterIndex, int val, String ignored) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); setNull(parameterIndex,val); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setString(int, java.lang.String) */ public void setString(int parameterIndex, String val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val; } /* (non-Javadoc) * @see java.sql.PreparedStatement#setBigDecimal(int, java.math.BigDecimal) */ public void setBigDecimal(int parameterIndex, BigDecimal val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val.toString(); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setURL(int, java.net.URL) */ public void setURL(int parameterIndex, URL val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val.toString(); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setArray(int, java.sql.Array) */ public void setArray(int parameterIndex, Array val) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setBlob(int, java.sql.Blob) */ public void setBlob(int parameterIndex, Blob arg1) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setClob(int, java.sql.Clob) */ public void setClob(int parameterIndex, Clob arg1) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setDate(int, java.sql.Date) */ public void setDate(int parameterIndex, Date val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val.toString(); } /* (non-Javadoc) * @see java.sql.PreparedStatement#getParameterMetaData() */ public ParameterMetaData getParameterMetaData() throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setRef(int, java.sql.Ref) */ public void setRef(int parameterIndex, Ref arg1) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#executeQuery() */ public ResultSet executeQuery() throws SQLException { return super.executeQuery(formatSQL()); } /* (non-Javadoc) * @see java.sql.PreparedStatement#getMetaData() */ public ResultSetMetaData getMetaData() throws SQLException { return getResultSet().getMetaData(); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setTime(int, java.sql.Time) */ public void setTime(int parameterIndex, Time val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val.toString(); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp) */ public void setTimestamp(int parameterIndex, Timestamp val) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); values[parameterIndex-1] = val.toString(); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setDate(int, java.sql.Date, java.util.Calendar) */ public void setDate(int parameterIndex, Date val, Calendar cal) throws SQLException { if(parameterIndex<1|parameterIndex>values.length) throw new SQLException("Set value "+parameterIndex+1+": out of range"); cal.setTime(val); values[parameterIndex-1] = cal.toString(); // TODO Auto-generated method stub } /* (non-Javadoc) * @see java.sql.PreparedStatement#setTime(int, java.sql.Time, java.util.Calendar) */ public void setTime(int parameterIndex, Time val, Calendar cal) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } /* (non-Javadoc) * @see java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp, java.util.Calendar) */ public void setTimestamp(int parameterIndex, Timestamp val, Calendar cal) throws SQLException { throw new SQLException("Not Implemented: PreparedStatement()"); } } --- NEW FILE: CIMCallableStatement.java --- package com.ibm.wbem.jdbc; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.Socket; import java.net.URL; import java.sql.Array; import java.sql.Blob; import java.sql.CallableStatement; import java.sql.Clob; import java.sql.Date; import java.sql.Ref; import java.sql.SQLException; import java.sql.Time; import java.sql.Timestamp; import java.util.Calendar; import java.util.Map; /* * Created on 16.02.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ /** * @author seyrich * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class CIMCallableStatement extends CIMPreparedStatement implements CallableStatement { /** * @param s * @param connection * @param sql * @throws SQLException */ public CIMCallableStatement(Socket s, CIMConnection connection, String sql) throws SQLException { super(s, connection, sql); // TODO Auto-generated constructor stub } /** * @param s * @param connection * @param sql * @throws SQLException */ /* (non-Javadoc) * @see java.sql.CallableStatement#wasNull() */ public boolean wasNull() throws SQLException { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.sql.CallableStatement#getByte(int) */ public byte getByte(int arg0) throws SQLException { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.CallableStatement#getDouble(int) */ public double getDouble(int arg0) throws SQLException { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.CallableStatement#getFloat(int) */ public float getFloat(int arg0) throws SQLException { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.CallableStatement#getInt(int) */ public int getInt(int arg0) throws SQLException { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.CallableStatement#getLong(int) */ public long getLong(int arg0) throws SQLException { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.CallableStatement#getShort(int) */ public short getShort(int arg0) throws SQLException { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.sql.CallableStatement#getBoolean(int) */ public boolean getBoolean(int arg0) throws SQLException { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.sql.CallableStatement#getBytes(int) */ public byte[] getBytes(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#registerOutParameter(int, int) */ public void registerOutParameter(int arg0, int arg1) throws SQLException { // TODO Auto-generated method stub } /* (non-Javadoc) * @see java.sql.CallableStatement#registerOutParameter(int, int, int) */ public void registerOutParameter(int arg0, int arg1, int arg2) throws SQLException { // TODO Auto-generated method stub } /* (non-Javadoc) * @see java.sql.CallableStatement#getObject(int) */ public Object getObject(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#getString(int) */ public String getString(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#registerOutParameter(int, int, java.lang.String) */ public void registerOutParameter(int arg0, int arg1, String arg2) throws SQLException { // TODO Auto-generated method stub } /* (non-Javadoc) * @see java.sql.CallableStatement#getByte(java.lang.String) */ public byte getByte(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getDouble(java.lang.String) */ public double getDouble(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getFloat(java.lang.String) */ public float getFloat(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getInt(java.lang.String) */ public int getInt(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getLong(java.lang.String) */ public long getLong(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getShort(java.lang.String) */ public short getShort(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getBoolean(java.lang.String) */ public boolean getBoolean(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getBytes(java.lang.String) */ public byte[] getBytes(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setByte(java.lang.String, byte) */ public void setByte(String arg0, byte arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setDouble(java.lang.String, double) */ public void setDouble(String arg0, double arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setFloat(java.lang.String, float) */ public void setFloat(String arg0, float arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#registerOutParameter(java.lang.String, int) */ public void registerOutParameter(String arg0, int arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setInt(java.lang.String, int) */ public void setInt(String arg0, int arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setNull(java.lang.String, int) */ public void setNull(String arg0, int arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#registerOutParameter(java.lang.String, int, int) */ public void registerOutParameter(String arg0, int arg1, int arg2) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setLong(java.lang.String, long) */ public void setLong(String arg0, long arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setShort(java.lang.String, short) */ public void setShort(String arg0, short arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setBoolean(java.lang.String, boolean) */ public void setBoolean(String arg0, boolean arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setBytes(java.lang.String, byte[]) */ public void setBytes(String arg0, byte[] arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getBigDecimal(int) */ public BigDecimal getBigDecimal(int arg0) throws SQLException { return new BigDecimal(111); } /* (non-Javadoc) * @see java.sql.CallableStatement#getBigDecimal(int, int) */ public BigDecimal getBigDecimal(int arg0, int arg1) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#getURL(int) */ public URL getURL(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#getArray(int) */ public Array getArray(int arg0) throws SQLException { throw new SQLException("Not Implemented: CallableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getBlob(int) */ public Blob getBlob(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#getClob(int) */ public Clob getClob(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#getDate(int) */ public Date getDate(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#getRef(int) */ public Ref getRef(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#getTime(int) */ public Time getTime(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#getTimestamp(int) */ public Timestamp getTimestamp(int arg0) throws SQLException { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.sql.CallableStatement#setAsciiStream(java.lang.String, java.io.InputStream, int) */ public void setAsciiStream(String arg0, InputStream arg1, int arg2) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setBinaryStream(java.lang.String, java.io.InputStream, int) */ public void setBinaryStream(String arg0, InputStream arg1, int arg2) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setCharacterStream(java.lang.String, java.io.Reader, int) */ public void setCharacterStream(String arg0, Reader arg1, int arg2) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#getObject(java.lang.String) */ public Object getObject(String arg0) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setObject(java.lang.String, java.lang.Object) */ public void setObject(String arg0, Object arg1) throws SQLException { // TODO Auto-generated method stub throw new SQLException("Not Implemented: callableStatement()"); } /* (non-Javadoc) * @see java.sql.CallableStatement#setObject(java.lang.String, java.lang.Object, int) */ public void setObject(String arg0, Object arg1, int arg2) throws SQLException { // TODO Auto-generated method stub throw new SQLExc... [truncated message content] |