DB URL syntax with table level specificity?
- From: Simon Brooke <simon@xxxxxxxxxxxxxx>
- Date: Fri, 15 Apr 2005 18:48:03 +0100
A JDBC URL generally addresses a database. I need a unique abstract
address for individual tables in a database. What I'm proposing to do
is to append something onto the database URL (and, obviously, strip it
off again at the appropriate moment). My current idea is to put the
table name into the query part of the URL, so that if you have a
database URL of the form
jdbc:postgresql://datahost:5432/mydatabase
the URL for the table called 'mytable' in that database would be
jdbc:postgresql://datahost:5432/mydatabase?table=mytable
With Microsoft-style URLs this would become
jdbc:microsoft:sqlserver://my.server:1433;DatabaseName=MYDB;SelectMethod=cursor;ProgamName=myprogram;table=mytable
so that the general rule is, when appending, if there is no question
mark ('?'), ampersand( '&') or semi-colon ( ';') in the string
representation I'll append a question mark followed by the token
'table' followed by an equality sign ('=') followed by the table name,
and when parsing I'll tokenise the URL on the characters ('?&;') to
recover my fragment.
So, two questions: firstly, am I reinventing a wheel?
And secondly, can anyone think of a reason why this should not work?
--
simon@xxxxxxxxxxxxxx (Simon Brooke) http://www.jasmine.org.uk/~simon/
The Conservative Party is now dead. The corpse may still be
twitching, but resurrection is not an option - unless Satan
chucks them out of Hell as too objectionable even for him.
.
- Follow-Ups:
- Re: DB URL syntax with table level specificity?
- From: Robert
- Re: DB URL syntax with table level specificity?
- Prev by Date: View the queries executed in MySQL
- Next by Date: Re: DB URL syntax with table level specificity?
- Previous by thread: View the queries executed in MySQL
- Next by thread: Re: DB URL syntax with table level specificity?
- Index(es):
Relevant Pages
|
|