Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmallsql <smallsql>2009-02-01 13:39:43 +0300
committersmallsql <smallsql>2009-02-01 13:39:43 +0300
commite167924d3adad7bf82113843a7c0e6a361b99c1a (patch)
tree1566f33d9c356a021e17fc7626474d7e1009adc2 /openjdk/sun/jdbc/odbc/JdbcOdbcCallableStatement.java
parent4afd2e4e6a4ab592d8313ab4012bc999ef3f0117 (diff)
many database metadata implement and updatable resultset added
Diffstat (limited to 'openjdk/sun/jdbc/odbc/JdbcOdbcCallableStatement.java')
-rw-r--r--openjdk/sun/jdbc/odbc/JdbcOdbcCallableStatement.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/openjdk/sun/jdbc/odbc/JdbcOdbcCallableStatement.java b/openjdk/sun/jdbc/odbc/JdbcOdbcCallableStatement.java
index 39ca89d7..81c92fc2 100644
--- a/openjdk/sun/jdbc/odbc/JdbcOdbcCallableStatement.java
+++ b/openjdk/sun/jdbc/odbc/JdbcOdbcCallableStatement.java
@@ -31,8 +31,9 @@ import java.sql.*;
import java.util.Calendar;
import java.util.Map;
-import cli.System.Data.ParameterDirection;
+import cli.System.Data.*;
import cli.System.Data.Common.*;
+import cli.System.Data.Odbc.*;
@@ -43,8 +44,8 @@ public class JdbcOdbcCallableStatement extends JdbcOdbcPreparedStatement impleme
private final Parameters parameters = new Parameters();
- public JdbcOdbcCallableStatement(JdbcOdbcConnection jdbcConn, DbCommand command, String sql){
- super(jdbcConn, command, sql);
+ public JdbcOdbcCallableStatement(JdbcOdbcConnection jdbcConn, OdbcCommand command, String sql, int resultSetType, int resultSetConcurrency){
+ super(jdbcConn, command, sql, resultSetType, resultSetConcurrency);
}
@@ -349,11 +350,7 @@ public class JdbcOdbcCallableStatement extends JdbcOdbcPreparedStatement impleme
public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException{
- DbParameter para = getPara(parameterIndex);
- int direction = para.get_Value() == null ? ParameterDirection.Output : ParameterDirection.InputOutput;
- para.set_Direction(ParameterDirection.wrap(direction));
- para.set_Size(1999); //TODO the value should depend of the type
- //TODO the type should be set
+ registerOutParameter(parameterIndex, sqlType, -1);
}
@@ -362,12 +359,22 @@ public class JdbcOdbcCallableStatement extends JdbcOdbcPreparedStatement impleme
}
- public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException{
+ public void registerOutParameter(int parameterIndex, int sqlType, int scaleOrLength) throws SQLException{
DbParameter para = getPara(parameterIndex);
int direction = para.get_Value() == null ? ParameterDirection.Output : ParameterDirection.InputOutput;
para.set_Direction(ParameterDirection.wrap(direction));
- para.set_Scale((byte)scale);
- //TODO see above
+
+ if(sqlType != Types.OTHER){
+ para.set_DbType(DbType.wrap(JdbcOdbcUtils.convertJdbc2AdoNetType(sqlType)));
+ }
+
+ if(scaleOrLength >= 0){
+ switch(sqlType){
+ case Types.DECIMAL:
+ case Types.NUMERIC:
+ para.set_Scale((byte)scaleOrLength);
+ }
+ }
}