Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38460

Re: Is there a SQL hashmap?

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Is there a SQL hashmap?
Date Fri, 29 Jun 2018 23:34:31 +0200
Lines 58
Message-ID <fpnmv9Fpj3vU1@mid.individual.net> (permalink)
References <031dadbc-3c27-4021-9b1d-8cb860c5e9f6@googlegroups.com> <fpfmegF9ol2U1@mid.individual.net> <34af17f0-0d59-4b87-8af0-01ce37deb5cb@googlegroups.com> <ph19nj$126q$1@gioia.aioe.org> <1d1add22-1fd4-45b1-964f-9501db447c91@googlegroups.com> <dc101d7c-a259-4364-b905-9c1346420149@googlegroups.com> <448e760f-e34d-4129-8ca6-5a699023789f@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net yjCepvG53kSZ1cGzyYCKdQYb6U7HEDbwgqIxbufm4pat2Jyu8=
Cancel-Lock sha1:Lcjj4T/yxkBWG8NS+KgZUgRQ/3M=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
In-Reply-To <448e760f-e34d-4129-8ca6-5a699023789f@googlegroups.com>
Content-Language en-US
Xref csiph.com comp.lang.java.programmer:38460

Show key headers only | View raw


On 28.06.2018 16:38, Eric Douglas wrote:
> On Thursday, June 28, 2018 at 9:49:47 AM UTC-4, Eric Douglas wrote:
>>>> You can in MS SQLServer
>>>> 
>>>> Just refer to the tables as somedatabasename.dbo.sometablename
>>>> and it should work.
>>>> 
>>>> Arne
>>> 
>>> but I am using java.sql.DriverManager.getConnection() which
>>> requires a connect string which includes the database name - ?
>> 
>> I see, that works only on other level... Currently we're using
>> connect string = jdbc:sqlserver://servername:port;databasename Then
>> we can do select * from tablename
>> 
>> The other option is to update every reference: connect string =
>> jdbc:sqlserver://servername:port Then select * from
>> databasename.dbo.tablename
>> 
>> This second format is only required if you need to connect tables
>> from multiple databases and looks uglier the more tables you join.
>> To switch from one to the other gets really ugly if you're changing
>> the connect string for a common connection method that already has
>> a bunch of sql statements which aren't referencing the database
>> name.
> 
> I don't know if this third party software would have issue with
> adding a database to the same instance.  The database part is
> optional in the connect string, but the second database we do have
> running on that server is in a totally different instance, different
> port, different credentials, one database running sql server 2012 one
> running 2014.  So JDBC can access both but as far as I know cannot
> join both in the same select statement.  Even if I can setup matching
> credentials, surely only one port at a time.  We have another server
> running mysql, probably the best place to store the lookup values,
> but would have to process in a separate JDBC instance after getting
> the results.

The way this is done in Oracle is to announce the remote database (b) in 
database (a).  Then you can query (a) and pull in data from (b).  Not 
sure though how SQL Server does it.

https://docs.oracle.com/en/database/oracle/oracle-database/18/admin/distributed-database-management.html

In PostgreSQL you can use a foreign data mapper for remote data and 
achieve the same - query database (a) and get also data from (b).

I did a quick search but did not find whether SQL Server supports a 
similar concept.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Is there a SQL hashmap? Eric Douglas <e.d.programmer@gmail.com> - 2018-06-26 09:03 -0700
  Re: Is there a SQL hashmap? Arne Vajhøj <arne@vajhoej.dk> - 2018-06-26 12:23 -0400
  Re: Is there a SQL hashmap? Robert Klemme <shortcutter@googlemail.com> - 2018-06-26 22:36 +0200
    Re: Is there a SQL hashmap? Eric Douglas <e.d.programmer@gmail.com> - 2018-06-26 14:02 -0700
      Re: Is there a SQL hashmap? Arne Vajhøj <arne@vajhoej.dk> - 2018-06-27 20:22 -0400
        Re: Is there a SQL hashmap? firstsql@gmail.com - 2018-06-27 20:53 -0700
        Re: Is there a SQL hashmap? Eric Douglas <e.d.programmer@gmail.com> - 2018-06-28 05:03 -0700
          Re: Is there a SQL hashmap? Eric Douglas <e.d.programmer@gmail.com> - 2018-06-28 06:49 -0700
            Re: Is there a SQL hashmap? Eric Douglas <e.d.programmer@gmail.com> - 2018-06-28 07:38 -0700
              Re: Is there a SQL hashmap? Andreas Leitgeb <avl@logic.at> - 2018-06-28 15:52 +0000
                Re: Is there a SQL hashmap? Martin Gregorie <martin@mydomain.invalid> - 2018-06-28 19:47 +0000
                Re: Is there a SQL hashmap? Arne Vajhøj <arne@vajhoej.dk> - 2018-06-28 18:34 -0400
                Re: Is there a SQL hashmap? Martin Gregorie <martin@mydomain.invalid> - 2018-06-28 23:20 +0000
                Re: Is there a SQL hashmap? Arne Vajhøj <arne@vajhoej.dk> - 2018-06-28 20:07 -0400
                Re: Is there a SQL hashmap? Eric Douglas <e.d.programmer@gmail.com> - 2018-06-29 05:11 -0700
                Re: Is there a SQL hashmap? Martin Gregorie <martin@mydomain.invalid> - 2018-06-29 12:30 +0000
                Re: Is there a SQL hashmap? Eric Douglas <e.d.programmer@gmail.com> - 2018-06-29 06:11 -0700
                Re: Is there a SQL hashmap? Martin Gregorie <martin@mydomain.invalid> - 2018-06-29 13:43 +0000
                Re: Is there a SQL hashmap? Robert Klemme <shortcutter@googlemail.com> - 2018-06-29 23:20 +0200
                Re: Is there a SQL hashmap? Martin Gregorie <martin@mydomain.invalid> - 2018-06-29 22:34 +0000
                Re: Is there a SQL hashmap? Arne Vajhøj <arne@vajhoej.dk> - 2018-06-30 16:36 -0400
                Re: Is there a SQL hashmap? Martin Gregorie <martin@mydomain.invalid> - 2018-06-30 23:00 +0000
              Re: Is there a SQL hashmap? Robert Klemme <shortcutter@googlemail.com> - 2018-06-29 23:34 +0200
            Re: Is there a SQL hashmap? Arne Vajhøj <arne@vajhoej.dk> - 2018-06-30 17:51 -0400
              Re: Is there a SQL hashmap? Eric Douglas <e.d.programmer@gmail.com> - 2018-07-03 07:13 -0700

csiph-web