Skip to content

Commit

Permalink
new version 1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
prrvchr committed Oct 11, 2024
1 parent 4a539c0 commit a787d8c
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 143 deletions.
2 changes: 1 addition & 1 deletion source/jdbcDriverOOo/Drivers.xcu
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
</node>
<node oor:name="JavaDriverClassPath" oor:op="replace">
<prop oor:name="Value" oor:type="xs:string">
<value>%origin%/driver/hsqldb-2.7.4-releasecandidate2.jar</value>
<value>%origin%/driver/hsqldb-2.7.4-releasecandidate3.jar</value>
</prop>
</node>
<node oor:name="JavaDriverClass" oor:op="replace">
Expand Down
Binary file not shown.
Binary file not shown.
14 changes: 8 additions & 6 deletions source/jdbcDriverOOo/resource/Driver_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@
10444=%s: is positioned on current row.
10445=%s: is positioned on insert row.

10450=%s: insert row with SQL command: %s.
10451=%s: update row with SQL command: %s.
10452=%s: delete row with SQL command: %s.
10453=%s: cancel row update on cache.
10454=%s: is positioned on cached current row.
10455=%s: is positioned on cached insert row.
10450=%s: use SQL mode for deletes / inserts / updates: <%s / %s / %s>
10451=%s: supports visibility for deletes / inserts / updates: <%s / %s / %s>
10452=%s: insert row with SQL command: %s.
10453=%s: update row with SQL command: %s.
10454=%s: delete row with SQL command: %s.
10455=%s: cancel row update on cache.
10456=%s: is positioned on cached current row.
10457=%s: is positioned on cached insert row.

10500=%s: creating <TableContainer>.
10501=%s: created <TableContainer>, id: %s
Expand Down
14 changes: 8 additions & 6 deletions source/jdbcDriverOOo/resource/Driver_fr_FR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@
10444=%s: est positionné sur la ligne actuelle.
10445=%s: est positionné sur la ligne d'insertion.
10450=%s: insère une ligne avec la commande SQL: %s.
10451=%s: met à jour une ligne avec la commande SQL: %s.
10452=%s: supprime une ligne avec la commande SQL: %s.
10453=%s: annule la mise à jour en cache.
10454=%s: est positionné sur la ligne actuelle en cache.
10455=%s: est positionné sur la ligne d'insertion en cache.
10450=%s: utilise le mode SQL pour les suppressions / les insertions / les mises à jour: <%s / %s / %s>
10451=%s: supporte la visibilité pour les suppressions / les insertions / les mises à jour: <%s / %s / %s>
10452=%s: insère une ligne avec la commande SQL: %s.
10453=%s: met à jour une ligne avec la commande SQL: %s.
10454=%s: supprime une ligne avec la commande SQL: %s.
10455=%s: annule la mise à jour en cache.
10456=%s: est positionné sur la ligne actuelle en cache.
10457=%s: est positionné sur la ligne d'insertion en cache.

10500=%s: création d'un <TableContainer>.
10501=%s: <TableContainer> créé, id: %s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,6 @@ public void setConnection(XInterface source,
throws SQLException
{
try {
System.out.println("DriverProvider.setConnection() 1");
m_infos = infos;
// XXX: SQLCommandSuffix is needed for building query from sql command.
m_SQLCommandSuffix = getDriverStringProperty(config1, "SQLCommandSuffix", m_SQLCommandSuffix);
Expand Down Expand Up @@ -869,9 +868,7 @@ public void setConnection(XInterface source,
m_enhanced = enhanced;

String url = getConnectionUrl(location, level);
System.out.println("DriverProvider.setConnection() 2");
java.sql.Connection connection = DriverManager.getConnection(url, getJdbcConnectionProperties(infos));
System.out.println("DriverProvider.setConnection() 3");
java.sql.DatabaseMetaData metadata = connection.getMetaData();

m_CatalogsInTableDefinitions = metadata.supportsCatalogsInTableDefinitions();
Expand All @@ -894,7 +891,6 @@ public void setConnection(XInterface source,
// XXX: We do not keep the connection but the statement
// XXX: which allows us to find the connection if necessary.
m_statement = connection.createStatement();
System.out.println("DriverProvider.setConnection() 4");
}
catch (java.sql.SQLException e) {
int resource = Resources.STR_LOG_NO_SYSTEM_CONNECTION;
Expand Down Expand Up @@ -922,7 +918,6 @@ else if (rstype == ResultSet.TYPE_SCROLL_SENSITIVE && m_InsertVisibleSensitive !
}
else {
visible = getConnection().getMetaData().ownInsertsAreVisible(rstype);
System.out.println("DriverProvider.isInsertVisible() 1: " + visible);
}
return visible;
}
Expand Down Expand Up @@ -965,23 +960,18 @@ private boolean isDeleteVisible(int rstype)
throws java.sql.SQLException
{
boolean visible = false;
System.out.println("DriverProviderMain.isDeleteVisible() 1 rstype: " + rstype);
if (rstype == ResultSet.TYPE_SCROLL_INSENSITIVE && m_DeleteVisibleInsensitive != null) {
System.out.println("DriverProviderMain.isDeleteVisible() 2 visible: " + m_DeleteVisibleInsensitive);
visible = m_DeleteVisibleInsensitive;
}
else if (rstype == ResultSet.TYPE_SCROLL_SENSITIVE && m_DeleteVisibleSensitive != null) {
visible = m_DeleteVisibleSensitive;
}
else {
System.out.println("DriverProviderMain.isDeleteVisible() 3");
visible = getConnection().getMetaData().ownDeletesAreVisible(rstype);
if (visible) {
System.out.println("DriverProviderMain.isDeleteVisible() 4");
visible = !getConnection().getMetaData().deletesAreDetected(rstype);
}
}
System.out.println("DriverProviderMain.isDeleteVisible() 5 visible: " + visible);
return visible;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,14 @@ public class Resources {
public static final int STR_LOG_RESULTSET_MOVE_TO_INSERT_ROW = (STR_LOG_MESSAGE_BASE + 445);

// com.sun.star.sdbc.XResultSetUpdate:
public static final int STR_LOG_CACHED_RESULTSET_INSERT_ROW = (STR_LOG_MESSAGE_BASE + 450);
public static final int STR_LOG_CACHED_RESULTSET_UPDATE_ROW = (STR_LOG_MESSAGE_BASE + 451);
public static final int STR_LOG_CACHED_RESULTSET_DELETE_ROW = (STR_LOG_MESSAGE_BASE + 452);
public static final int STR_LOG_CACHED_RESULTSET_CANCEL_ROW_UPDATES = (STR_LOG_MESSAGE_BASE + 453);
public static final int STR_LOG_CACHED_RESULTSET_MOVE_TO_CURRENT_ROW = (STR_LOG_MESSAGE_BASE + 454);
public static final int STR_LOG_CACHED_RESULTSET_MOVE_TO_INSERT_ROW = (STR_LOG_MESSAGE_BASE + 455);
public static final int STR_LOG_CACHED_RESULTSET_SQL_MODE_USED = (STR_LOG_MESSAGE_BASE + 450);
public static final int STR_LOG_CACHED_RESULTSET_VISIBILITY = (STR_LOG_MESSAGE_BASE + 451);
public static final int STR_LOG_CACHED_RESULTSET_INSERT_ROW = (STR_LOG_MESSAGE_BASE + 452);
public static final int STR_LOG_CACHED_RESULTSET_UPDATE_ROW = (STR_LOG_MESSAGE_BASE + 453);
public static final int STR_LOG_CACHED_RESULTSET_DELETE_ROW = (STR_LOG_MESSAGE_BASE + 454);
public static final int STR_LOG_CACHED_RESULTSET_CANCEL_ROW_UPDATES = (STR_LOG_MESSAGE_BASE + 455);
public static final int STR_LOG_CACHED_RESULTSET_MOVE_TO_CURRENT_ROW = (STR_LOG_MESSAGE_BASE + 456);
public static final int STR_LOG_CACHED_RESULTSET_MOVE_TO_INSERT_ROW = (STR_LOG_MESSAGE_BASE + 457);

// io.github.prrvchr.uno.sdbcx.TableContainerBase:
public static final int STR_LOG_CREATE_TABLES = (STR_LOG_MESSAGE_BASE + 500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@
import java.util.Map;
import java.util.Vector;

import com.sun.star.logging.LogLevel;

import io.github.prrvchr.jdbcdriver.ConnectionLog;
import io.github.prrvchr.jdbcdriver.DriverProvider;
import io.github.prrvchr.jdbcdriver.Resources;
import io.github.prrvchr.jdbcdriver.rowset.BaseRow;
import io.github.prrvchr.jdbcdriver.rowset.InsertRow;
import io.github.prrvchr.jdbcdriver.rowset.Row;
Expand Down Expand Up @@ -79,13 +82,15 @@ public ScrollableResultSet(DriverProvider provider,
public void moveToCurrentRow()
throws SQLException
{
m_logger.logprb(LogLevel.FINE, Resources.STR_LOG_CACHED_RESULTSET_MOVE_TO_CURRENT_ROW);
setInsertMode(false);
}

@Override
public void moveToInsertRow()
throws SQLException
{
m_logger.logprb(LogLevel.FINE, Resources.STR_LOG_CACHED_RESULTSET_MOVE_TO_INSERT_ROW);
setInsertMode(true);
}

Expand All @@ -107,17 +112,18 @@ public void insertRow()
}
// XXX: The result set cannot be updated, the insert
// XXX: will be done by a SQL command from the cached insert row.
int cursor = getRowCount() + 1;
int position = getMaxPosition() + 1;
InsertRow insert = m_InsertRow.clown();
getRowSetWriter().insertRow(insert);
for (String query : insert.getQueries()) {
m_logger.logprb(LogLevel.FINE, Resources.STR_LOG_CACHED_RESULTSET_INSERT_ROW, query);
}
getRowData().add(new Row(insert));
// XXX: cursor and absolute position must be set on the inserted row
m_Cursor = cursor;
m_Position = position;
m_Cursor = getRowCount();
m_Position = getMaxPosition();
setInsertMode(false);
// XXX: We must be able to respond positively to the insert
m_InsertedRow = cursor;
m_InsertedRow = m_Cursor;
}

@Override
Expand Down Expand Up @@ -150,8 +156,9 @@ public void updateRow()
// XXX: The result set cannot be updated, the update
// XXX: will be done by a SQL command from the cached current row.
Row row = (Row) getCurrentRow();
if (row.isUpdated()) {
getRowSetWriter().updateRow(row);
getRowSetWriter().updateRow(row);
for (String query : row.getQueries()) {
m_logger.logprb(LogLevel.FINE, Resources.STR_LOG_CACHED_RESULTSET_UPDATE_ROW, query);
}
}

Expand All @@ -167,6 +174,9 @@ public void deleteRow()
int position = m_Cursor;
Row row = (Row) getCurrentRow();
getRowSetWriter().deleteRow(row);
for (String query : row.getQueries()) {
m_logger.logprb(LogLevel.FINE, Resources.STR_LOG_CACHED_RESULTSET_DELETE_ROW, query);
}
m_DeletedRows.add(position);
}

Expand Down
Loading

0 comments on commit a787d8c

Please sign in to comment.