Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Commit ca31604

Browse files
Cleanup
1 parent ca6f534 commit ca31604

10 files changed

+123
-398
lines changed

src/main/java/xdev/db/firebird/jdbc/FirebirdConnectionInformation.java

Lines changed: 19 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,8 @@
1717
*/
1818
package xdev.db.firebird.jdbc;
1919

20-
/*-
21-
* #%L
22-
* Firebird
23-
* %%
24-
* Copyright (C) 2003 - 2023 XDEV Software
25-
* %%
26-
* This program is free software: you can redistribute it and/or modify
27-
* it under the terms of the GNU Lesser General Public License as
28-
* published by the Free Software Foundation, either version 3 of the
29-
* License, or (at your option) any later version.
30-
*
31-
* This program is distributed in the hope that it will be useful,
32-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
33-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34-
* GNU General Lesser Public License for more details.
35-
*
36-
* You should have received a copy of the GNU General Lesser Public
37-
* License along with this program. If not, see
38-
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
39-
* #L%
40-
*/
41-
4220
import com.xdev.jadoth.sqlengine.dbms.DbmsConnectionInformation;
21+
4322
import xdev.db.ConnectionInformation;
4423

4524

@@ -50,68 +29,62 @@ public class FirebirdConnectionInformation extends ConnectionInformation<Firebir
5029
// ///////////////////
5130

5231
/**
53-
* @param user
54-
* the user
55-
* @param password
56-
* the password
57-
* @param database
58-
* the database
59-
* @param urlExtension
60-
* the extended url properties
61-
* @param dbmsAdaptor
62-
* the dbms adaptor
32+
* @param user the user
33+
* @param password the password
34+
* @param database the database
35+
* @param urlExtension the extended url properties
36+
* @param dbmsAdaptor the dbms adaptor
6337
*/
64-
public FirebirdConnectionInformation(final String host, final int port, final String user,
65-
final String password, final String database, final String urlExtension,
66-
final FirebirdDbms dbmsAdaptor)
38+
public FirebirdConnectionInformation(
39+
final String host, final int port, final String user,
40+
final String password, final String database, final String urlExtension,
41+
final FirebirdDbms dbmsAdaptor)
6742
{
68-
super(host,port,user,password,database,urlExtension,dbmsAdaptor);
43+
super(host, port, user, password, database, urlExtension, dbmsAdaptor);
6944
}
7045

71-
7246
// /////////////////////////////////////////////////////////////////////////
7347
// getters //
7448
// ///////////////////
49+
7550
/**
7651
* Gets the database.
77-
*
52+
*
7853
* @return the database
7954
*/
8055
public String getDatabase()
8156
{
8257
return this.getCatalog();
8358
}
8459

85-
8660
// /////////////////////////////////////////////////////////////////////////
8761
// setters //
8862
// ///////////////////
63+
8964
/**
9065
* Sets the database.
91-
*
92-
* @param database
93-
* the database to set
66+
*
67+
* @param database the database to set
9468
*/
9569
public void setDatabase(final String database)
9670
{
9771
this.setCatalog(database);
9872
}
9973

100-
10174
// /////////////////////////////////////////////////////////////////////////
10275
// override methods //
10376
// ///////////////////
77+
10478
/**
10579
* @see DbmsConnectionInformation#createJdbcConnectionUrl()
10680
*/
10781
@Override
10882
public String createJdbcConnectionUrl()
10983
{
110-
String url = "jdbc:firebirdsql:" + getHost() + "/" + getPort() + ":" + getCatalog();
111-
return appendUrlExtension(url);
84+
final String url = "jdbc:firebirdsql:" + this.getHost() + "/" + this.getPort() + ":" + this.getCatalog();
85+
return this.appendUrlExtension(url);
11286
}
11387

114-
11588
/**
11689
* @see com.xdev.jadoth.sqlengine.dbms.DbmsConnectionInformation#getJdbcDriverClassName()
11790
*/
@@ -120,5 +93,4 @@ public String getJdbcDriverClassName()
12093
{
12194
return "org.firebirdsql.jdbc.FBDriver";
12295
}
123-
12496
}

src/main/java/xdev/db/firebird/jdbc/FirebirdDDLMapper.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,6 @@
1717
*/
1818
package xdev.db.firebird.jdbc;
1919

20-
/*-
21-
* #%L
22-
* Firebird
23-
* %%
24-
* Copyright (C) 2003 - 2023 XDEV Software
25-
* %%
26-
* This program is free software: you can redistribute it and/or modify
27-
* it under the terms of the GNU Lesser General Public License as
28-
* published by the Free Software Foundation, either version 3 of the
29-
* License, or (at your option) any later version.
30-
*
31-
* This program is distributed in the hope that it will be useful,
32-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
33-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34-
* GNU General Lesser Public License for more details.
35-
*
36-
* You should have received a copy of the GNU General Lesser Public
37-
* License along with this program. If not, see
38-
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
39-
* #L%
40-
*/
41-
4220
import com.xdev.jadoth.sqlengine.dbms.standard.StandardDDLMapper;
4321

4422

src/main/java/xdev/db/firebird/jdbc/FirebirdDMLAssembler.java

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,17 @@
2121
import com.xdev.jadoth.sqlengine.dbms.standard.StandardDMLAssembler;
2222

2323

24-
/*-
25-
* #%L
26-
* Firebird
27-
* %%
28-
* Copyright (C) 2003 - 2023 XDEV Software
29-
* %%
30-
* This program is free software: you can redistribute it and/or modify
31-
* it under the terms of the GNU Lesser General Public License as
32-
* published by the Free Software Foundation, either version 3 of the
33-
* License, or (at your option) any later version.
34-
*
35-
* This program is distributed in the hope that it will be useful,
36-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
37-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38-
* GNU General Lesser Public License for more details.
39-
*
40-
* You should have received a copy of the GNU General Lesser Public
41-
* License along with this program. If not, see
42-
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
43-
* #L%
44-
*/
4524
public class FirebirdDMLAssembler extends StandardDMLAssembler<FirebirdDbms>
4625
{
4726
public FirebirdDMLAssembler(final FirebirdDbms dbms)
4827
{
4928
super(dbms);
5029
}
5130

52-
5331
@Override
5432
protected StringBuilder assembleSelectRowLimit(
5533
SELECT query, StringBuilder sb, int flags,
56-
String clauseSeperator, String newLine, int indentLevel)
34+
String clauseSeperator, String newLine, int indentLevel)
5735
{
5836
Integer skip = query.getOffsetSkipCount();
5937
Integer range = query.getFetchFirstRowCount();
@@ -63,7 +41,7 @@ protected StringBuilder assembleSelectRowLimit(
6341
if(skip != null)
6442
{
6543
sb.append(newLine).append(clauseSeperator).append("ROWS ").append(skip)
66-
.append(" TO ").append(skip + range - 1);
44+
.append(" TO ").append(skip + range - 1);
6745
}
6846
else
6947
{
@@ -73,7 +51,7 @@ protected StringBuilder assembleSelectRowLimit(
7351
else if(skip != null)
7452
{
7553
sb.append(newLine).append(clauseSeperator).append("ROWS ").append(skip).append(" TO ")
76-
.append(Integer.MAX_VALUE);
54+
.append(Integer.MAX_VALUE);
7755
}
7856

7957
return sb;

src/main/java/xdev/db/firebird/jdbc/FirebirdDbms.java

Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,27 @@
1717
*/
1818
package xdev.db.firebird.jdbc;
1919

20-
/*-
21-
* #%L
22-
* Firebird
23-
* %%
24-
* Copyright (C) 2003 - 2023 XDEV Software
25-
* %%
26-
* This program is free software: you can redistribute it and/or modify
27-
* it under the terms of the GNU Lesser General Public License as
28-
* published by the Free Software Foundation, either version 3 of the
29-
* License, or (at your option) any later version.
30-
*
31-
* This program is distributed in the hope that it will be useful,
32-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
33-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34-
* GNU General Lesser Public License for more details.
35-
*
36-
* You should have received a copy of the GNU General Lesser Public
37-
* License along with this program. If not, see
38-
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
39-
* #L%
40-
*/
41-
4220
import com.xdev.jadoth.sqlengine.dbms.DbmsAdaptor;
4321
import com.xdev.jadoth.sqlengine.dbms.SQLExceptionParser;
4422
import com.xdev.jadoth.sqlengine.internal.DatabaseGateway;
4523
import com.xdev.jadoth.sqlengine.internal.tables.SqlTableIdentity;
4624

4725

4826
public class FirebirdDbms
49-
extends
50-
DbmsAdaptor.Implementation<FirebirdDbms, FirebirdDMLAssembler, FirebirdDDLMapper, FirebirdRetrospectionAccessor, FirebirdSyntax>
27+
extends
28+
DbmsAdaptor.Implementation<FirebirdDbms, FirebirdDMLAssembler, FirebirdDDLMapper, FirebirdRetrospectionAccessor,
29+
FirebirdSyntax>
5130
{
5231
// /////////////////////////////////////////////////////////////////////////
5332
// constants //
5433
// ///////////////////
5534

56-
/** The Constant MAX_VARCHAR_LENGTH. */
57-
protected static final int MAX_VARCHAR_LENGTH = Integer.MAX_VALUE;
58-
59-
protected static final char IDENTIFIER_DELIMITER = '"';
60-
61-
public static final FirebirdSyntax SYNTAX = new FirebirdSyntax();
62-
35+
public static final FirebirdSyntax SYNTAX = new FirebirdSyntax();
36+
/**
37+
* The Constant MAX_VARCHAR_LENGTH.
38+
*/
39+
protected static final int MAX_VARCHAR_LENGTH = Integer.MAX_VALUE;
40+
protected static final char IDENTIFIER_DELIMITER = '"';
6341

6442
// /////////////////////////////////////////////////////////////////////////
6543
// constructors //
@@ -70,37 +48,32 @@ public FirebirdDbms()
7048
this(new SQLExceptionParser.Body());
7149
}
7250

73-
7451
/**
75-
* @param sqlExceptionParser
76-
* the sql exception parser
52+
* @param sqlExceptionParser the sql exception parser
7753
*/
7854
public FirebirdDbms(final SQLExceptionParser sqlExceptionParser)
7955
{
80-
super(sqlExceptionParser,false);
56+
super(sqlExceptionParser, false);
8157
this.setRetrospectionAccessor(new FirebirdRetrospectionAccessor(this));
8258
this.setDMLAssembler(new FirebirdDMLAssembler(this));
8359
this.setSyntax(SYNTAX);
8460
}
8561

86-
8762
/**
8863
* @see DbmsAdaptor#createConnectionInformation(String, int, String, String, String, String)
8964
*/
9065
@Override
91-
public FirebirdConnectionInformation createConnectionInformation(final String host,
92-
final int port, final String user, final String password, final String catalog, final String properties)
66+
public FirebirdConnectionInformation createConnectionInformation(
67+
final String host,
68+
final int port, final String user, final String password, final String catalog, final String properties)
9369
{
94-
return new FirebirdConnectionInformation(host,port,user,password,catalog,properties, this);
70+
return new FirebirdConnectionInformation(host, port, user, password, catalog, properties, this);
9571
}
9672

97-
9873
/**
99-
* HSQL does not support any means of calculating table columns selectivity
100-
* as far as it is known.
101-
*
102-
* @param table
103-
* the table
74+
* HSQL does not support any means of calculating table columns selectivity as far as it is known.
75+
*
76+
* @param table the table
10477
* @return the object
10578
*/
10679
@Override
@@ -109,7 +82,6 @@ public Object updateSelectivity(final SqlTableIdentity table)
10982
return null;
11083
}
11184

112-
11385
/**
11486
* @see DbmsAdaptor#assembleTransformBytes(byte[], StringBuilder)
11587
*/
@@ -119,7 +91,6 @@ public StringBuilder assembleTransformBytes(final byte[] bytes, final StringBuil
11991
return null;
12092
}
12193

122-
12394
/**
12495
* @see com.xdev.jadoth.sqlengine.dbms.DbmsAdaptor.Implementation#getRetrospectionAccessor()
12596
*/
@@ -129,7 +100,6 @@ public FirebirdRetrospectionAccessor getRetrospectionAccessor()
129100
throw new RuntimeException("HSQL Retrospection not implemented yet!");
130101
}
131102

132-
133103
/**
134104
* @see com.xdev.jadoth.sqlengine.dbms.DbmsAdaptor#initialize(com.xdev.jadoth.sqlengine.internal.DatabaseGateway)
135105
*/
@@ -138,7 +108,6 @@ public void initialize(final DatabaseGateway<FirebirdDbms> dbc)
138108
{
139109
}
140110

141-
142111
/**
143112
* @see com.xdev.jadoth.sqlengine.dbms.DbmsAdaptor#rebuildAllIndices(java.lang.String)
144113
*/
@@ -148,14 +117,12 @@ public Object rebuildAllIndices(final String fullQualifiedTableName)
148117
return null;
149118
}
150119

151-
152120
@Override
153121
public boolean supportsOFFSET_ROWS()
154122
{
155123
return true;
156124
}
157125

158-
159126
/**
160127
* @see com.xdev.jadoth.sqlengine.dbms.DbmsAdaptor#getMaxVARCHARlength()
161128
*/
@@ -165,7 +132,6 @@ public int getMaxVARCHARlength()
165132
return MAX_VARCHAR_LENGTH;
166133
}
167134

168-
169135
@Override
170136
public char getIdentifierDelimiter()
171137
{

0 commit comments

Comments
 (0)