Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions java/CloudServices.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Services>
<Service>
<Name>GXTEST</Name>
<Type>DataAccess</Type>
<ClassName>com.genexus.db.driver.GXDBMSGxTest</ClassName>
</Service>
</Services>
183 changes: 183 additions & 0 deletions java/client.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
[Client]
MODEL_NUM= 2
GENERATOR_NUM= 12
LOGIN_AS_USERID=0
SMTP_HOST=
NAME_SPACE= com.mockdb
NAME_HOST=
CORBA_SERVER_NAME=
DCOM_GUID=
CONN_TIMEOUT=300
HELP_MODE=WINHTML
HELP_BASEURL=
PREFERRED_UI=BEST
JFC_LF=NATIVE
CALENDAR=1
CALC=1
WP_RESIZE=1
SHOW_STATUS=1
FIELD_EXIT=Tab
ESCAPE_FUNCTION=Exit_form
KEY_REFRESH=5
KEY_PROMPT=4
MDI_FORMS=1
REMOTE_CALLS=NEVER
IMAGE_SUBST=0
CS_CONNECT=First
CS_REORG=1
CS_REORGJAVA=1
SUBFILE_ORDER=Y
FC_READONLY=GRAYED
PACKAGE=com.mockdb
DECIMAL_POINT=.
DATE_FMT= DMY
CTOD_DATE_FMT= L
BLANK_EMPTY_DATE=0
TIME_FMT=12
YEAR_LIMIT=40
COMPRESS_HTML=1
DocumentType=HTML5
IE_COMPATIBILITY_VIEW=EmulateIE7
EXPOSE_METADATA= 0
WEB_IMAGE_DIR=/static
HTTP_BACKEND_URL=
WEB_STATIC_DIR=
ORQ_CLIENT_URL=
ORQ_SERVER_DIR=
TMPMEDIA_DIR=PrivateTempStorage
PRINT_LAYOUT_METADATA_DIR=LayoutMetadata
HTTP_PROTOCOL=Unsecure
SAMESITE_COOKIE=Lax
StorageTimeZone= 1
GX_BUILD_NUMBER=17233991
ODBC_CALLS=0
NameSpace1= com.mockdb
LANGUAGE=German
LANG_NAME=German
Theme=Carmine
CS_BLOB_PATH=PublicTempStorage
SUBMIT_POOL_SIZE=5
CACHE_TTL_0=-1
CACHE_TTL_1=60
CACHE_TTL_2=600
CACHE_TTL_3=0
CACHE_STORAGE_SIZE=0
CACHING=0
SMART_CACHING=0
CACHE_INVALIDATION_TOKEN=202231018204023
EVENT_BEFORE_COMMIT=
EVENT_AFTER_COMMIT=
EVENT_BEFORE_ROLLBACK=
EVENT_AFTER_ROLLBACK=
EVENT_BEFORE_CONNECT=
EVENT_AFTER_CONNECT=
ENABLE_MANAGEMENT=0
EnableIntegratedSecurity=0
IntegratedSecurityLoginWeb=
IntegratedSecurityNotAuthorizedWeb=
HTTPCLIENT_MAX_SIZE=1000
HTTPCLIENT_MAX_PER_ROUTE=1000
VER_STAMP=20220103.214234
[language|English]
code= eng
time_fmt= 12
decimal_point= .
thousand_sep= ,
date_fmt= MDY
culture= en-US
[language|German]
code= German
time_fmt= 12
decimal_point= .
thousand_sep= ,
date_fmt= DMY
culture= de-DE
[language|TraditionalChinese]
code= cht
time_fmt= 24
decimal_point= .
thousand_sep= ,
date_fmt= YMD
culture= zh-TW
[language|SimplifiedChinese]
code= chs
time_fmt= 24
decimal_point= .
thousand_sep= ,
date_fmt= YMD
culture= zh-CN
[language|Spanish]
code= spa
time_fmt= 24
decimal_point= ,
thousand_sep= .
date_fmt= DMY
culture= es-ES
[language|Japanese]
code= jap
time_fmt= 24
decimal_point= .
thousand_sep= ,
date_fmt= YMD
culture= ja-JP
[language|Portuguese]
code= por
time_fmt= 24
decimal_point= ,
thousand_sep= .
date_fmt= DMY
culture= pt-BR
[language|Italian]
code= ita
time_fmt= 24
decimal_point= ,
thousand_sep= .
date_fmt= DMY
culture= it-IT
[language|Arabic]
code= Arabic
time_fmt= 24
decimal_point= ,
thousand_sep= .
date_fmt= DMY
culture= ar-SA
[com.mockdb]
GXDB_LOCATION=
JTA=0
DataSource1=DEFAULT
JDBC_LOG= c:\temp\UTL.log
JDBCLogEnabled=1
JDBCUniqueName=0
JDBCLogPath=
JDBCLogLevel=0
JDBCLogBuffer=0
JDBCLogDetail=0
[com.mockdb|DEFAULT]
CS_DBNAME=
INFORMIX_DB=ANSI
CS_LIBL400=
CS_PACKAGE400=
DB2400_DATE_DATATYPE=
CS_SCHEMA=
USER_ID=G8xdg8k/gK9eOCDgU75tkr==
USER_PASSWORD=4gPZ5cDtMVud7diJ/gIVrg==
CS_CONNECT=First
WAIT_RECORD=0
LOCK_RETRY=10
LoginInServer=1
JDBC_DRIVER=org.sqlite.JDBC
DB_URL=jdbc:sqlite:sample.db
USE_JDBC_DATASOURCE=0
JDBC_DATASOURCE=
MAX_CURSOR=100
INITIALIZE_NEW=1
ISOLATION_LEVEL=CR
XBASE_TINT=1
DBMS=sqlserver
UnlimitedRWPool=1
PoolRWEnabled=1
RecycleRW=1
RecycleRWType=1
RecycleRWMin=30
POOLSIZE_RW=10
POOL_STARTUP=0
5 changes: 5 additions & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.36.0.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>10.2.0.jre8</version>
Expand Down
Binary file added java/sample.db
Binary file not shown.
20 changes: 20 additions & 0 deletions java/src/main/java/com/genexus/db/driver/DataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
import java.util.Enumeration;
import java.util.Hashtable;

import com.genexus.Application;
import com.genexus.common.classes.AbstractDataSource;
import com.genexus.diagnostics.core.ILogger;
import com.genexus.diagnostics.core.LogManager;
import com.genexus.util.GXService;
import com.genexus.util.GXServices;

public class DataSource extends AbstractDataSource
{
public static final ILogger logger = LogManager.getLogger(DataSource.class);
public static String INFORMIX_DB_ANSI = "ANSI";
public static String INFORMIX_DB_LOGGED = "Logged";
public static String INFORMIX_DB_NOTLOGGED = "NotLogged";
Expand Down Expand Up @@ -310,6 +316,20 @@ private void setDBMS(String dbmsName)
{
throw new InternalError("Unrecognized DBMS in configuration file : " + dbmsName + " / " + className);
}
GXService providerService = Application.getGXServices().get(GXServices.DATA_ACCESS_SERVICE);
if (providerService != null)
{
String providerClassName = providerService.getClassName();
try
{
logger.info("Loading providerService:" + providerClassName);
dbms = (GXDBMS) Class.forName(providerClassName).getConstructor(new Class[] {GXDBMS.class}).newInstance(new Object[] {dbms});
}
catch(Exception ex)
{
logger.error("Couldn't create DATA_ACCESS_PROVIDER as : " + providerClassName, ex);
}
}
}

public synchronized IConnectionPool getConnectionPool()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public boolean execute() throws SQLException
log(GXDBDebug.LOG_MIN, "Executing callable statement");
try
{
ret = stmt.execute();
ret = con.getDBMS().execute(stmt);
log(GXDBDebug.LOG_MIN, "succesfully executed");
}
catch (SQLException sqlException)
Expand All @@ -65,7 +65,7 @@ public boolean execute() throws SQLException
}
else
{
ret = stmt.execute();
ret = con.getDBMS().execute(stmt);
}

//con.setNotInUse(this);
Expand Down
4 changes: 4 additions & 0 deletions java/src/main/java/com/genexus/db/driver/GXDBMS.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;

Expand Down Expand Up @@ -44,6 +45,9 @@ public interface GXDBMS
void commit(Connection con) throws SQLException;
void rollback(Connection con) throws SQLException;
ResultSet executeQuery(PreparedStatement stmt, boolean hold) throws SQLException;
int executeUpdate(PreparedStatement stmt) throws SQLException;
boolean execute(PreparedStatement stmt) throws SQLException;
int[] executeBatch(Statement stmt) throws SQLException;

void setDatabaseName(String dbName);
String getDatabaseName();
Expand Down
20 changes: 16 additions & 4 deletions java/src/main/java/com/genexus/db/driver/GXDBMSaccess.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.genexus.db.driver;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.*;
import java.util.Date;

import com.genexus.CommonUtil;
Expand All @@ -15,6 +12,21 @@ public ResultSet executeQuery(PreparedStatement stmt, boolean hold) throws SQLEx
return stmt.executeQuery();
}

public int executeUpdate(PreparedStatement stmt) throws SQLException
{
return stmt.executeUpdate();
}

public boolean execute(PreparedStatement stmt) throws SQLException
{
return stmt.execute();
}

public int[] executeBatch(Statement stmt) throws SQLException
{
return stmt.executeBatch();
}

public void setDatabaseName(String dbName)
{
}
Expand Down
15 changes: 15 additions & 0 deletions java/src/main/java/com/genexus/db/driver/GXDBMSas400.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ public ResultSet executeQuery(PreparedStatement stmt, boolean hold) throws SQLEx
return stmt.executeQuery();
}

public int executeUpdate(PreparedStatement stmt) throws SQLException
{
return stmt.executeUpdate();
}

public boolean execute(PreparedStatement stmt) throws SQLException
{
return stmt.execute();
}

public int[] executeBatch(Statement stmt) throws SQLException
{
return stmt.executeBatch();
}

public boolean DataTruncation(SQLException e)
{
return (e.getErrorCode() == 01004 );
Expand Down
15 changes: 15 additions & 0 deletions java/src/main/java/com/genexus/db/driver/GXDBMScloudscape.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ public ResultSet executeQuery(PreparedStatement stmt, boolean hold) throws SQLEx
return stmt.executeQuery();
}

public int executeUpdate(PreparedStatement stmt) throws SQLException
{
return stmt.executeUpdate();
}

public boolean execute(PreparedStatement stmt) throws SQLException
{
return stmt.execute();
}

public int[] executeBatch(Statement stmt) throws SQLException
{
return stmt.executeBatch();
}

public boolean isAlive(GXConnection con)
{

Expand Down
20 changes: 16 additions & 4 deletions java/src/main/java/com/genexus/db/driver/GXDBMSdb2.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.genexus.db.driver;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.*;
import java.util.Date;

import com.genexus.CommonUtil;
Expand All @@ -15,6 +12,21 @@ public ResultSet executeQuery(PreparedStatement stmt, boolean hold) throws SQLEx
return stmt.executeQuery();
}

public int executeUpdate(PreparedStatement stmt) throws SQLException
{
return stmt.executeUpdate();
}

public boolean execute(PreparedStatement stmt) throws SQLException
{
return stmt.execute();
}

public int[] executeBatch(Statement stmt) throws SQLException
{
return stmt.executeBatch();
}

public boolean isAlive(GXConnection con)
{
try
Expand Down
Loading