Access (mdb) in Railo

153 views
Skip to first unread message

Michel Renard

unread,
Jun 17, 2013, 11:30:45 AM6/17/13
to ra...@googlegroups.com
Hello to all
How to connect a database mdb in Railo?
I tried to install it with this:
JDBC-ODBC Bridge (for Access, MSSQL)
But when I save, it gives me a crash that Railo stop automatically.
Have an approach regarding the crash?
Knowing that I'm under linux is I wonder if mdb (microsoft access) runs under linux, in connection fashion ...
Thank you for your help
Michel
Version Railo 4

Matt Quackenbush

unread,
Jun 17, 2013, 12:00:35 PM6/17/13
to ra...@googlegroups.com
Microsoft Access (nor any other Microsoft product other than Skype) runs on Linux.

HTH



--
Did you find this reply useful?  Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/d7f6a464-7d35-4770-8216-df178e76bfba%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Sean Daniels

unread,
Jun 17, 2013, 12:21:53 PM6/17/13
to ra...@googlegroups.com
I've used Jackcess to successfully read/write to MDBs on Linux. I wouldn't ever use it for the primary backend, but we had some legacy stuff we needed to support (simple selects and inserts) and this does the job.

http://jackcess.sourceforge.net

I wrote a really basic CFC wrapper for it to I can share with you if you like.

Michel Renard

unread,
Jun 18, 2013, 4:17:47 AM6/18/13
to ra...@googlegroups.com
hello

Ok, but that answer to my question is why this plant Railo Server ...
If it can help me, come on, give me your tutorial
Or tell me how do you install a database mdb in Railo Server ...
Yours
Michel

Michael Forell

unread,
Jun 18, 2013, 6:39:01 AM6/18/13
to ra...@googlegroups.com
Hello!

As I had problems with Jackcess a few years ago, I use http://www.csv-jdbc.com/stels_mdb_jdbc.htm 
Just select "Other JDBC Driver", Class is: "jstels.jdbc.mdb.MDBDriver", DSN is: jdbc:jstels:mdb:c:/path/to.mdb

Unfortunately, Stels MDB is not free of charge. However, it works for me.

Michael

Michel Renard

unread,
Jun 19, 2013, 9:39:39 AM6/19/13
to ra...@googlegroups.com
OK Michael
How to install Railo in Jackcess class with the following parameter Other - JDBC Driver:
What I do exactly ...
Thank you for helping me
Because I'm sure it will work with Jackcess, I think ... because my code works CFM nickel, but the connection via mdb given not work.

Thank you for your help
Michel

Sean Daniels

unread,
Jun 19, 2013, 10:12:49 AM6/19/13
to ra...@googlegroups.com
Jackcess is not a database driver, so you do not install it using Other - JDBC Driver. You have to use it programmatically in your application. For example, here is some code for doing a "select all" on an MDB table (this is snipped from my CFC). It's not pretty but it gets the job done.


<cfscript>
// Jackcess Database object
local.jackcess = createobject("java","com.healthmarketscience.jackcess.Database","#getDirectoryfromPath(getCurrentTemplatePath())#jackcess-1.2.7.jar");
// Java file handle for the MDB
local.File = createobject("java","java.io.File").init( arguments.dbFile );

// set the Jackcess Database object to variables scope
variables.DB = local.jackcess.open(local.File);

// get the Jackcess Table object
local.table = variables.DB.getTable(arguments.tablename);
local.table.reset();

// ///////////////////////////////////////////////////
// figure out the columns
local.columnList = [];
for (local.i in local.table.getColumns()) {
arrayappend(local.columnList,local.i.getName());
}
// ///////////////////////////////////////////////////

// make the query
var result = querynew( arraytolist(local.columnList) );

var i = 0;
// how many rows do we have?
local.recordcount = local.table.getRowCount()

// loop from 1 to totalrows and get each row
for (i=1;i lte local.recordcount;i++) {
local.row = local.table.getNextRow();

// add a row to our query
queryaddrow(result);

// populate the columns for this row
for (local.col in local.columnList) {
querysetcell(result,local.col,local.row.get(local.col))
}
}

</cfscript>
> To view this discussion on the web visit https://groups.google.com/d/msgid/railo/b884a454-d784-45cb-a89a-223e65f77a33%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages