[libgda] Minor JDBC corrections
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Minor JDBC corrections
- Date: Thu, 25 Apr 2013 20:31:26 +0000 (UTC)
commit 67e7d53019e86484ae64117a10d28d8601a6f7fc
Author: Vivien Malerba <malerba gnome-db org>
Date: Thu Apr 25 22:03:56 2013 +0200
Minor JDBC corrections
providers/jdbc/gda-jdbc-recordset.c | 17 ++++++++++++++++-
providers/jdbc/libmain.c | 1 +
providers/jdbc/provider.java | 21 ++++++++++++++++++---
3 files changed, 35 insertions(+), 4 deletions(-)
---
diff --git a/providers/jdbc/gda-jdbc-recordset.c b/providers/jdbc/gda-jdbc-recordset.c
index 12e7722..182903e 100644
--- a/providers/jdbc/gda-jdbc-recordset.c
+++ b/providers/jdbc/gda-jdbc-recordset.c
@@ -140,7 +140,9 @@ gda_jdbc_recordset_get_type (void)
return type;
}
-/* Same as GdaJValue::jdbc_type_to_g_type */
+/* Same as GdaJValue::jdbc_type_to_g_type
+ * See http://docs.oracle.com/javase/6/docs/api/constant-values.html#java.sql.Types.ARRAY for reference
+ */
static GType
jdbc_type_to_g_type (gint jdbc_type)
{
@@ -177,22 +179,35 @@ jdbc_type_to_g_type (gint jdbc_type)
case 4: /* INTEGER */
return G_TYPE_INT;
case 2000: /* JAVA_OBJECT */
+ return GDA_TYPE_BINARY;
+ case -16: /* LONGNVARCHAR */
+ return G_TYPE_STRING;
case -4: /* LONGVARBINARY */
return GDA_TYPE_BINARY;
case -1: /* LONGVARCHAR */
return G_TYPE_STRING;
+ case -15: /* NCHAR */
+ return G_TYPE_STRING;
+ case 2011: /* NCLOB */
+ return GDA_TYPE_BINARY;
case 0: /* NULL */
return GDA_TYPE_NULL;
case 2: /* NUMERIC */
return GDA_TYPE_NUMERIC;
+ case -9: /* NVARCHAR */
+ return G_TYPE_STRING;
case 1111: /* OTHER */
return GDA_TYPE_BINARY;
case 7: /* REAL */
return G_TYPE_FLOAT;
case 2006: /* REF */
return GDA_TYPE_BINARY;
+ case -8: /* ROWID */
+ return G_TYPE_STRING;
case 5: /* SMALLINT */
return GDA_TYPE_SHORT;
+ case 2009: /* SQLXML */
+ return G_TYPE_STRING;
case 2002: /* STRUCT */
return GDA_TYPE_BINARY;
case 92: /* TIME */
diff --git a/providers/jdbc/libmain.c b/providers/jdbc/libmain.c
index d73be8c..f333a7e 100644
--- a/providers/jdbc/libmain.c
+++ b/providers/jdbc/libmain.c
@@ -569,6 +569,7 @@ get_database_name_from_driver_name (const gchar *driver_name)
{"com.mysql.jdbc.Driver", "MySQL"},
{"org.gjt.mm.mysql.Driver", "MySQL"},
{"oracle.jdbc.driver.OracleDriver", "Oracle"},
+ {"oracle.jdbc.OracleDriver", "Oracle"},
{"com.pointbase.jdbc.jdbcUniversalDriver", "PointBase"},
{"org.postgresql.Driver", "PostgreSQL"},
{"postgresql.Driver", "v6.5 and earlier"},
diff --git a/providers/jdbc/provider.java b/providers/jdbc/provider.java
index dc4a121..b3b194d 100644
--- a/providers/jdbc/provider.java
+++ b/providers/jdbc/provider.java
@@ -603,6 +603,7 @@ abstract class GdaJValue {
}
// Same as gda-jdbc-recordset.c::jdbc_type_to_g_type
+ // see http://docs.oracle.com/javase/6/docs/api/constant-values.html#java.sql.Types.ARRAY for
reference
public static String jdbc_type_to_g_type (int type) {
switch (type) {
case java.sql.Types.VARCHAR:
@@ -633,25 +634,39 @@ abstract class GdaJValue {
case java.sql.Types.DOUBLE:
return "gdouble";
case java.sql.Types.FLOAT:
- case java.sql.Types.REAL:
return "gfloat";
case java.sql.Types.INTEGER:
return "gint";
case java.sql.Types.JAVA_OBJECT:
+ return "GdaBinary";
+ case java.sql.Types.LONGNVARCHAR:
+ return "gchararray";
case java.sql.Types.LONGVARBINARY:
return "GdaBinary";
case java.sql.Types.LONGVARCHAR:
return "gchararray";
+ case java.sql.Types.NCHAR:
+ return "gchararray";
+ case java.sql.Types.NCLOB:
+ return "GdaBinary";
case java.sql.Types.NULL:
- return null;
+ return "GdaNull";
case java.sql.Types.NUMERIC:
return "GdaNumeric";
+ case java.sql.Types.NVARCHAR:
+ return "gchararray";
case java.sql.Types.OTHER:
return "GdaBinary";
+ case java.sql.Types.REAL:
+ return "gfloat";
case java.sql.Types.REF:
- return "GdaBinary";
+ return "GdaBinary";
+ case java.sql.Types.ROWID:
+ return "gchararray";
case java.sql.Types.SMALLINT:
return "GdaShort";
+ case java.sql.Types.SQLXML:
+ return "gchararray";
case java.sql.Types.STRUCT:
return "GdaBinary";
case java.sql.Types.TIME:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]