hallo
EDIT:
hab jetzt ca 10x die fehlermeldung beim posten bekommen:
"Der Titel darf aus Spamschutzgründen nicht das Wort 'a' enthalten !" ?!?!
habe mir eine liste memacht mit den datentypen die es in einer MSSQL datebank geben kann und habe die dann auf die klassen in java gemappt.
ein paar fehlen noch...
ein paar hab ich schon, bin mir aber nicht 100% sicher ob alles passt. wäre super wenn ihr mir da helfen könntet...
bei den auskommentierten weiss ich ned welchen datentyp ich nehmen kann/soll
binäre daten hab ich in der form noch nie verarbeitet... (bin mir aber nicht sicher ob alle werte brauche...)
wills nur der komplettheit zu liebe machen
EDIT:
hab jetzt ca 10x die fehlermeldung beim posten bekommen:
"Der Titel darf aus Spamschutzgründen nicht das Wort 'a' enthalten !" ?!?!
habe mir eine liste memacht mit den datentypen die es in einer MSSQL datebank geben kann und habe die dann auf die klassen in java gemappt.
ein paar fehlen noch...
ein paar hab ich schon, bin mir aber nicht 100% sicher ob alles passt. wäre super wenn ihr mir da helfen könntet...
Code:
private static final Map<String, Class> typeMap;
static {
// defines MSSQL DATE TYPES
typeMap = new HashMap<String, Class>();
typeMap.put("char", String.class); // Fixed-length character data with maximum length of 8,000 characters
typeMap.put("nchar", String.class); // Fixed-length Unicode data with maximum length of 4,000 characters
typeMap.put("nvarchar", String.class); // Variable-length Unicode data with maximum length of 4,000 characters
typeMap.put("varchar", String.class); // Variable-length data with maximum of 8,000 characters
typeMap.put("text", String.class); // Variable-length data with maximum length of 2^31 - 1 characters
typeMap.put("ntext", String.class); // Variable-length Unicode data with maximum length of 2^30 - 1 characters
typeMap.put("uniqueidentifier", String.class); // globally unique identifier
typeMap.put("bit", boolean.class); // Integer data with either 1 or 0 value
typeMap.put("tinyint", byte.class); // Integer data from 0 through 255
typeMap.put("smallint", short.class); // Integer data from -2^15 through 2^15 - 1
typeMap.put("int", int.class); // Integer data from -2^31 through 2^31 - 1
typeMap.put("bigint", int.class); // Integer data from -2^63 through 2^63-1
typeMap.put("decimal", int.class); // Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1
typeMap.put("numeric", int.class); // Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1
typeMap.put("smallmoney", int.class); // Monetary data values from -2^63 through 2^63 - 1
typeMap.put("money", int.class); // Monetary data values from -214,748.3648 through +214,748.3647
typeMap.put("float", float.class); // Floating precision number data from -1.79E + 308 through 1.79E + 308
typeMap.put("real", double.class); // Floating precision number data from -3.40E + 38 through 3.40E + 38
typeMap.put("datetime", Date.class); // Date and time data from January 1, 1753, through December 31, 9999, with an accuracy of 3.33 milliseconds
typeMap.put("smalldatetime", Date.class); // Date and time data from January 1, 1900, through June 6, 2079, with an accuracy of one minute
/* NOT IMPLEMENTED YET - which data type??
binary // Fixed-length binary data with maximum length of 8,000 bytes
varbinary // Variable-length binary data with maximum length of 8,000 bytes
image // Variable-length binary data with maximum length of 2^31 - 1 bytes
cursor // reference to cursor
sql_variant // data type that stores values of various data types, except text, ntext, timestamp, and sql_variant table // special data type used to store result set for later processing
timestamp // database-wide unique number that gets updated every time row gets updated
*/
// etc.
}
bei den auskommentierten weiss ich ned welchen datentyp ich nehmen kann/soll
binäre daten hab ich in der form noch nie verarbeitet... (bin mir aber nicht sicher ob alle werte brauche...)
wills nur der komplettheit zu liebe machen