English 中文(简体)
如何跟踪用于多数据库连接的图谋信息?
原标题:How to track pagination information for multi database connection?

我是继建立之后的。

MySQL server instance1 MySQL server instance2

在表一中,有一个单独的表格记录,分门别类。 我必须从每个方面检索数据,并显示在盖里的数据。

Here are the consideration to be made: 1) From each database instance only 1000 records needs to be got. 2) Merge these 1000 records and sort in ascending order by a default column. 3) Again from the merged records get only 1000 records to be shown in a Grid. 4) For the next 1000 records we should not show any of the earlier records which have been shown.

我所面临的主要问题是,如何独一无二地确定从单列记录中显示的最后一行。

I thought about doing it this way: 1) Get the rowid for each record from all the connection. But from two instances the rowid would be same then how would I identify which record is from which database? 2) Check for rowid and primary key combination. But if the client sets the primary key s auto-increment value as same on all the instance then we would not get a unique combination.

我要么没有东西,要么没有其他办法去做?

我正在利用亚行的链接连接数据库。

[SOLVED IT] Solved the problem by writing a small function which calculates and create a map for the number of records to be fetched from each connection for each iteration.

职业介绍会可以在此补充《守则》,因为它是IP客户。

问题回答

You usually uniquely identify a row with a POJO class where you override your hashCode() and equals() methods basing on your class fields. You can put your last row into a HashMap and check against it. A rownumber retrieved from the tables can be achieved by creating one using RANK() and PARTITION BY. Create a temporary or tmp_ table with your merging results then drop it.

我们希望,这一帮助是微不足道的。

如果两个神秘的事例能够相互看到,如何形成一种看法,联合国就得出两个问题的结果。 那么,在java世界上,你可以就这一看法提出疑问或gin想?





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签