db2 express c

is anyone using this database?

it seems to offer quite a lot for free…

I messed with it for a while at work. It seems to be a good product, but I’ve gone with PostgreSQL for most projects.

On OSX, I’m using JavaVMMBS of Monkeybread to connect to DB2 Express. Works fine in my tests.

It requires Java to be installed on a client computer. I add the file db2jcc.jar to the resources folder of the app. Examples for using JavaDatabase can be found in the MBS plugins examples folder (“JavaDatabase”)

Example (just if someone is interested):

[code]Sub Open()
Dim f As FolderItem = GetFolderItem(App.ExecutableFile.Parent.Parent.Child(“Resources”).AbsolutePath + “db2jcc.jar”)

If Not f.Exists Then
MsgBox “Missing java db connector classes!(db2jcc.jar)”
Return
End If

Dim v As New JavaVMMBS(f)

If v.Handle = 0 Then
MsgBox “Can’t create Java VM!” + EndOfLine + EndOfLine _

  • “Java must be installed to run this application”
    Quit
    End If

d=New JavaDatabaseMBS(v,“com.ibm.db2.jcc.DB2Driver”)

End Sub
[/code]

And in a PushButton’s action event of the testapp:

[code]Sub Action()
dim r as JavaResultSetMBS

If j = Nil Then
Dim wP As New InputBox
wp.ShowModal
End If

If self.myPassword <> “” Then
If j = Nil Then

  Dim constr As String = "jdbc:db2://" + Self.host + ":"+ Self.port + "/" + Self.database
  
  j=d.getConnection( constr,Self.user,Self.myPassword)
End If

if j<>Nil then
  
  r = j.SelectSQL("SELECT * FROM TESTADR")
  Listbox1.DeleteAllRows
  while r.NextRecord
    Listbox1.AddRow(Str(r.getInt("id")))
    Listbox1.Cell(Listbox1.LastIndex,1)=r.getString("strasse")
    Listbox1.Cell(Listbox1.LastIndex,2)=r.getString("postleitzahl")
    Listbox1.Cell(Listbox1.LastIndex,3)=r.getString("stadt")
    Listbox1.Cell(Listbox1.LastIndex,4)=r.getString("land")
  wend
  
end if
PushButton1.Caption="Refresh"
r = Nil

Else
Return
End If

Exception e as JavaExceptionMBS
MsgBox e.message+" errorcode: "+str(e.ErrorNumber)

End Sub
[/code]

Our SQL Plugin can directly connect to DB2.

I’ve never been able to get this running, that’s why I used Java. Afaik there is no working osx driver available.

Ah, yes that could be a problem. I know some people use it with our plugin on Windows.

I’m thinking of using a mac-mini server to host it, or possibly a Linux box, so that we can offer a lower cost option to our customers

the clients would be \(mostly) windows pc’s so it looks like it could be an interesting option.

not sure I want to add Java as a requirement though, I was hoping there would be an ODBC driver at the very least.

For DB2 Express I’m using a Windows Server. Linux should be fine as well, but I doubt that you would be able to make it run on a Mac Mini.

If you have Windows clients only, then I would check out the solution offered by MBS.

Personally, I prefer to spend a few $ for CubeSQL and gain a MUCH simpler to install and manage database system (Really : MUCH MUCH simpler). However, if your clients are huge enterprises with DB2 already running, with a DB Admin in place, etc - then this (or free databases like Postgres) may not be an option.

But just the time you spend to figure out where to get which libraries and how to get them on your customers pc, etc - let alone how to make use of it in your xojo code, all this is only worth the pain if you have at least one customer who is willing to pay for your time, because they already made a strategic decision to use IBM DB2, and nothing else.

I played with it for a while a few years ago. I was comparing DB2 Community Edition, Oracle Express and MS SQL Express. MS SQL Server Express was by far the easiest to manage.

In the end, it was easier to use MS SQL (I was using VB6 at the time). I am now migrating away from MS SQL to PostgreSQL, which is multi platform, as opposed to MS SQL, which is Windows-only. What is holding me back right now, is the fact that I invested quite a bit of money in management tools for MS SQL (products from Red Gate Software). I cannot find the equivalent for Postgre. Or perhaps I just have not found the right tools for me yet.