Kaydet (Commit) e030f2a3 authored tarafından Jean-Pierre Ledure's avatar Jean-Pierre Ledure

Access2Base - Support of Hsqldb 2.3

Addition of CLOB and BLOB datatypes

Change-Id: If42c0dbb1862f525d2a0a1abf98bd053543a3d3c
üst 18565a34
...@@ -305,12 +305,14 @@ Const cstMaxTextLength = 65535 ...@@ -305,12 +305,14 @@ Const cstMaxTextLength = 65535
Case .CHAR : _PropertyGet = dbText Case .CHAR : _PropertyGet = dbText
Case .VARCHAR : _PropertyGet = dbChar Case .VARCHAR : _PropertyGet = dbChar
Case .LONGVARCHAR : _PropertyGet = dbMemo Case .LONGVARCHAR : _PropertyGet = dbMemo
Case .CLOB : _PropertyGet = dbMemo
Case .DATE : _PropertyGet = dbDate Case .DATE : _PropertyGet = dbDate
Case .TIME : _PropertyGet = dbTime Case .TIME : _PropertyGet = dbTime
Case .TIMESTAMP : _PropertyGet = dbTimeStamp Case .TIMESTAMP : _PropertyGet = dbTimeStamp
Case .BINARY : _PropertyGet = dbBinary Case .BINARY : _PropertyGet = dbBinary
Case .VARBINARY : _PropertyGet = dbVarBinary Case .VARBINARY : _PropertyGet = dbVarBinary
Case .LONGVARBINARY : _PropertyGet = dbLongBinary Case .LONGVARBINARY : _PropertyGet = dbLongBinary
Case .BLOB : _PropertyGet = dbLongBinary
Case .BOOLEAN : _PropertyGet = dbBoolean Case .BOOLEAN : _PropertyGet = dbBoolean
Case Else : _PropertyGet = dbUndefined Case Else : _PropertyGet = dbUndefined
End Select End Select
...@@ -352,9 +354,9 @@ Const cstMaxTextLength = 65535 ...@@ -352,9 +354,9 @@ Const cstMaxTextLength = 65535
Case UCase("FieldSize") ' Probably physical size = 2 * unicode string length Case UCase("FieldSize") ' Probably physical size = 2 * unicode string length
With com.sun.star.sdbc.DataType With com.sun.star.sdbc.DataType
Select Case Column.Type Select Case Column.Type
Case .LONGVARCHAR Case .VARCHAR, .LONGVARCHAR, .CLOB
Set oSize = Column.getCharacterStream Set oSize = Column.getCharacterStream
Case .LONGVARBINARY, .VARBINARY, .BINARY Case .LONGVARBINARY, .VARBINARY, .BINARY, .BLOB
Set oSize = Column.getBinaryStream Set oSize = Column.getBinaryStream
Case Else Case Else
Set oSize = Nothing Set oSize = Nothing
...@@ -660,14 +662,14 @@ Const cstMaxLength = 64000 ...@@ -660,14 +662,14 @@ Const cstMaxLength = 64000
With com.sun.star.sdbc.DataType With com.sun.star.sdbc.DataType
Select Case Column.Type Select Case Column.Type
Case .BINARY, .VARBINARY, .LONGVARBINARY Case .BINARY, .VARBINARY, .LONGVARBINARY, .BLOB
If psMethod <> "ReadAllBytes" Then Goto Trace_Error If psMethod <> "ReadAllBytes" Then Goto Trace_Error
Set oStream = oSimpleFileAccess.openFileRead(sFile) Set oStream = oSimpleFileAccess.openFileRead(sFile)
lFileLength = oStream.getLength() lFileLength = oStream.getLength()
If lFileLength = 0 Then Goto Trace_File If lFileLength = 0 Then Goto Trace_File
Column.updateBinaryStream(oStream, lFileLength) Column.updateBinaryStream(oStream, lFileLength)
oStream.closeInput() oStream.closeInput()
Case .LONGVARCHAR Case .VARCHAR, .LONGVARCHAR, .CLOB
If psMethod <> "ReadAllText" Then Goto Trace_Error If psMethod <> "ReadAllText" Then Goto Trace_Error
sMemo = "" sMemo = ""
lFileLength = 0 lFileLength = 0
...@@ -728,10 +730,10 @@ Dim sFile As String, oSimpleFileAccess As Object, sMethod As String, oStream As ...@@ -728,10 +730,10 @@ Dim sFile As String, oSimpleFileAccess As Object, sMethod As String, oStream As
oSimpleFileAccess = CreateUnoService("com.sun.star.ucb.SimpleFileAccess") oSimpleFileAccess = CreateUnoService("com.sun.star.ucb.SimpleFileAccess")
With com.sun.star.sdbc.DataType With com.sun.star.sdbc.DataType
Select Case Column.Type Select Case Column.Type
Case .BINARY, .VARBINARY, .LONGVARBINARY Case .BINARY, .VARBINARY, .LONGVARBINARY, .BLOB
If psMethod <> "WriteAllBytes" Then Goto Trace_Error If psMethod <> "WriteAllBytes" Then Goto Trace_Error
Set oStream = Column.getBinaryStream() Set oStream = Column.getBinaryStream()
Case .LONGVARCHAR Case .VARCHAR, .LONGVARCHAR, .CLOB
If psMethod <> "WriteAllText" Then Goto Trace_Error If psMethod <> "WriteAllText" Then Goto Trace_Error
Set oStream = Column.getCharacterStream() Set oStream = Column.getCharacterStream()
Case Else Case Else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment