Connection |
Henry Widd |
2006-11-23 06:54:33 |
Hi, I am having trouble with the connection URL. Firstly, I want to connect using a system dsn, but cannot get HXTT to work with that:
e.g.: for dsn named MS_DB hxtt.url=jdbc:access:/MS_DB does not work. What is the syntax please?
If I cannot do that, I will connect via the filename, but do not want to use a drive letter. I can connect using line 1 below, but not line 2 which contains the full UNC path
1. hxtt.url=jdbc:access:/f:/gs_china/ipodb/Multiple IPO.mdb?charSet=UTF-16
2. hxtt.url=jdbc:access:/\\eqitln03s/tech/china/podb/Multiple.mdb?charSet=UTF-16
Another thing I want to do is this select, which works with Sun's driver:
select Date() as sysDate, Time() as sysTime;
When I do that with HXTT, I am told there is a syntax error, so what should be the correct query for getting the system date?
Thanks for your help.
Henry
|
Re:Connection |
HXTT Support |
2006-11-23 07:25:32 |
>e.g.: for dsn named MS_DB hxtt.url=jdbc:access:/MS_DB does not work. What is
> the syntax please?
HXTT Access needn't any dsn, and can run on any platform with Java.
>1. hxtt.url=jdbc:access:/f:/gs_china/ipodb/Multiple IPO.mdb?charSet=UTF-16
You can use "jdbc:access:/f:/gs_china/ipodb/" too. You needn't to set charSet=UTF-16 since HXTT Access supports unicode.
>2. hxtt.url=jdbc:access:/\\eqitln03s/tech/china/podb/Multiple.mdb?charSet=UTF-16
You need to use a free JDBC url, "jdbc:access:/" or "jdbc:access:///". Then you can use some full UNC path names in SQL to visit your servers. For instance:
select * from "\\eqitln03s/tech/china/podb/Multiple.mdb".test;
>Another thing I want to do is this select, which works with Sun's driver:
>select Date() as sysDate, Time() as sysTime;
For instance:
?date();
? time();
select top 1 Date() as sysDate, Time() as sysTime form atable;
BTW, you can use date(), time() as insertvalue, for instance, insert into atable (acolumn,bcolumn) values(date(),time());
|
Re:Re:Connection |
HXTT Support |
2006-11-23 07:37:59 |
You can use
select * from (VALUES date(),time()) AS tableName(sysDate,sysTime );
too.
|
Re:Re:Re:Connection |
HXTT Support |
2006-11-23 07:40:41 |
select * from (VALUES curdate(),curtime()) AS tableName(sysDate,sysTime );
will be a preferable sql:)
|
Re:Re:Re:Re:Connection |
Henry Widd |
2006-11-23 10:18:17 |
Thanks for the help. On connecting via a free url ("jdbc:access:/" ) - I am a bit concerned about how my DataSource is going to manage connection pooling. Presumably it won't create a pool so will have to make a new connection each time.
Are you also saying that there is not way to connect via DSN?
Thanks
|
Re:Re:Re:Re:Re:Connection |
HXTT Support |
2006-11-23 17:30:44 |
>I am a bit concerned about how my DataSource is going to manage connection
> pooling. Presumably it won't create a pool so will have to make a new
> connection each time.
OS will do the necessary file cache. It hasn't any difference for you to use free url or normal embedded url. Network file cache is slower than disk file, you should use embedded url( or remote url with AccessServer) if all of your database files is at eqitln03s host.
|
Re:Re:Re:Re:Re:Re:Connection |
Henry Widd |
2006-11-23 22:21:58 |
ok - Now I'm trying out a date query using the full unc path but getting an error. If I do not include the quotes I get a grammar error, rather than this one.
[select top 1 Date() as sysDate, Time() as sysTime from "\\eqitln03s\tech\china\ipodb\Multiple IP.mdb".tblSubscription;]; SQL state [60000]; error code [393216]; java.lang.NullPointerException
at com.hxtt.global.c.(Unknown Source)
at com.hxtt.concurrent.aa.(Unknown Source
Please help. BTW, in the most recent date query that was suggested, where would I include the UNC path?
|
Re:Re:Re:Re:Re:Re:Re:Connection |
HXTT Support |
2006-11-24 00:23:40 |
Passed test with: select top 1 Date() as sysDate, Time() as sysTime from "\\localhost\f$\mdbfiles\db1.mdb".hxtt2;
Are you using a latest package?
> in the most recent date query that was suggested, where would I include the UNC path?
>>select * from (VALUES curdate(),curtime()) AS tableName(sysDate,sysTime );
You needn't because VALUES tables is memory table:)
|
Re:Re:Re:Re:Re:Re:Re:Re:Connection |
Henry Widd |
2006-11-24 00:39:12 |
I am using "Access JDBC 3.0 Package" downloaded yesterday and my query still does not work.
The reason I do not want to use the drive letter in the connection string is that I am running my program as a service - which even running as a particular user does not have that drive mapped, but if I log in and run from the command line there is no problem. Can I confirm that there is definitely no way of putting the unc in the connection string or using dsn? Otherwise I am going to be unable to run this program as a service.
Thanks
|
Re:Re:Re:Re:Re:Re:Re:Re:Connection |
HXTT Support |
2006-11-24 01:02:25 |
> but if I log in and run from the command line there is no problem.
>Otherwise I am going to be unable to run this program as a service.
It's a security issue for network file share. What's your appplication server? If you run it in ColdFusion with correct user right, it won't be issue.
|