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

Commit c4589d1

Browse files
Setup important files and start to refactoring
1 parent 9137e78 commit c4589d1

14 files changed

+1681
-24
lines changed

.gitignore

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
# Compiled class file
2-
*.class
1+
target/
2+
bin/
33

4-
# Log file
5-
*.log
4+
# IDEA
5+
.idea/
6+
*.iml
67

7-
# BlueJ files
8-
*.ctxt
9-
10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
12-
13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23-
hs_err_pid*
24-
replay_pid*
8+
# Eclispe
9+
.settings
10+
.classpath
11+
.project

README.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
1-
# Sybase
2-
1+
[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/xapi-db-sybase)](https://mvnrepository.com/artifact/com.xdev-software/xapi-db-sybase)
2+
[![Build](https://img.shields.io/github/workflow/status/xdev-software/xapi-db-sybase/Check%20Build/develop)](https://github.com/xdev-software/xapi-db-sybase/actions/workflows/checkBuild.yml?query=branch%3Adevelop)
3+
[![javadoc](https://javadoc.io/badge2/com.xdev-software/xapi-db-sybase/javadoc.svg)](https://javadoc.io/doc/com.xdev-software/xapi-db-sybase)
4+
5+
# SqlEngine Database Adapter Sybase
6+
7+
The XDEV Application Framework provides an abstraction over database dialects as part of its SqlEngine. This module is the Database Adapter for Sybase which includes the Sybase-specific implementation for database access.
8+
9+
# Important Note
10+
11+
We once wrote this Database Adapter for Sybase 6.0. According to the following comment on StackOverflow (https://stackoverflow.com/a/26350230/12336976) this jar is now part of Sybase jConnect.
12+
The Maven Dependency (found on https://mvnrepository.com/artifact/com.esen.jdbc/sybase-jconn3/6.0 ), should not be used.
13+
In order to get this Adapter to run, you have to register on their website and manually download the JAR.
14+
15+
## XDEV-IDE
16+
XDEV(-IDE) is a visual Java development environment for fast and easy application development (RAD - Rapid Application Development). XDEV differs from other Java IDEs such as Eclipse or NetBeans, focusing on programming through a far-reaching RAD concept. The IDE's main components are a Swing GUI builder, the XDEV Application Framework, and numerous drag-and-drop tools and wizards with which the functions of the framework can be integrated.
17+
18+
The XDEV-IDE was license-free up to version 4 inclusive and is available for Windows, Linux and macOS. From version 5, the previously proprietary licensed additional modules are included in the IDE and the license of the entire product has been converted to a paid subscription model. The XDEV Application Framework, which represents the core of the RAD concept of XDEV and is part of every XDEV application, was released as open-source in 2008.
19+
20+
## Contributing
21+
22+
We would absolutely love to get the community involved, and we welcome any form of contributions – comments and questions on different communication channels, issues and pull request in the repositories, and anything that you build and share using our components.
23+
24+
### Get in touch with the team
25+
26+
Twitter: https://twitter.com/xdevsoftware
27+
<br/>
28+
Mail: opensource@xdev-software.de
29+
30+
### Some ways to help:
31+
32+
- **Report bugs**: File issues on GitHub.
33+
- **Send pull requests**: If you want to contribute code, check out the development instructions below.
34+
35+
We encourage you to read the [contribution instructions by GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing) also.
36+
37+
## Dependencies and Licenses
38+
The XDEV Application Framework is released under [GNU Lesser General Public License version 3](https://www.gnu.org/licenses/lgpl-3.0.en.html) aka LGPL 3<br/>
39+
View the [summary of all dependencies online](https://xdev-software.github.io/xapi-db-sybase/dependencies/)
40+
41+
## Support
42+
If you need support as soon as possible and you can not wait for any pull request, feel free to use our support
43+
https://xdev.software/en/services/support
44+
45+
## Releasing [![Build](https://img.shields.io/github/workflow/status/xdev-software/xapi-db-sybase/Release?label=Release)](https://github.com/xdev-software/xapi-db-sybase/actions/workflows/release.yml)
46+
Consider doing a [test-deployment](https://github.com/xdev-software/xapi-db-sybase/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
47+
48+
If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes.
49+
50+
When the release is finished do the following:
51+
* Merge the auto-generated PR (with the incremented version number) back into the ``develop``
52+
* Add the release notes to the [GitHub release](https://github.com/xdev-software/xapi-db-sybase/releases/latest)

pom.xml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<licenses>
8+
<license>
9+
<name>GNU Lesser General Public License version 3</name>
10+
<url>https://www.gnu.org/licenses/lgpl-3.0.en.html</url>
11+
</license>
12+
</licenses>
13+
14+
15+
<groupId>groupId</groupId>
16+
<artifactId>Sybase</artifactId>
17+
<version>1.0-SNAPSHOT</version>
18+
19+
<properties>
20+
<maven.compiler.source>1.8</maven.compiler.source>
21+
<maven.compiler.target>1.8</maven.compiler.target>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<xdev.xapi.version>6.0.1</xdev.xapi.version>
24+
<junit.version>4.13.2</junit.version>
25+
<license.licenseName>lgpl_v3</license.licenseName>
26+
</properties>
27+
28+
<organization>
29+
<name>XDEV Software</name>
30+
<url>https://xdev-software.com</url>
31+
</organization>
32+
<inceptionYear>2003</inceptionYear>
33+
<repositories>
34+
<repository>
35+
<id>ICM-Repository</id>
36+
<url>http://maven.icm.edu.pl/artifactory/repo/</url>
37+
</repository>
38+
</repositories>
39+
40+
41+
<dependencies>
42+
<dependency>
43+
<groupId>com.xdev-software</groupId>
44+
<artifactId>xapi</artifactId>
45+
<version>${xdev.xapi.version}</version>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>junit</groupId>
50+
<artifactId>junit</artifactId>
51+
<version>${junit.version}</version>
52+
<scope>test</scope>
53+
</dependency>
54+
</dependencies>
55+
56+
<build>
57+
<plugins>
58+
59+
<plugin>
60+
<groupId>org.apache.maven.plugins</groupId>
61+
<artifactId>maven-clean-plugin</artifactId>
62+
<version>3.1.0</version>
63+
</plugin>
64+
<plugin>
65+
<groupId>org.apache.maven.plugins</groupId>
66+
<artifactId>maven-deploy-plugin</artifactId>
67+
<version>3.0.0-M1</version>
68+
</plugin>
69+
<plugin>
70+
<groupId>org.apache.maven.plugins</groupId>
71+
<artifactId>maven-install-plugin</artifactId>
72+
<version>3.0.0-M1</version>
73+
</plugin>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-jar-plugin</artifactId>
77+
<version>3.2.0</version>
78+
</plugin>
79+
<plugin>
80+
<groupId>org.apache.maven.plugins</groupId>
81+
<artifactId>maven-resources-plugin</artifactId>
82+
<version>3.2.0</version>
83+
</plugin>
84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-site-plugin</artifactId>
87+
<version>3.9.1</version>
88+
</plugin>
89+
90+
<plugin>
91+
<groupId>org.apache.maven.plugins</groupId>
92+
<artifactId>maven-source-plugin</artifactId>
93+
<version>3.2.1</version>
94+
<executions>
95+
<execution>
96+
<id>attach-sources</id>
97+
<phase>verify</phase>
98+
<goals>
99+
<goal>jar-no-fork</goal>
100+
</goals>
101+
</execution>
102+
</executions>
103+
</plugin>
104+
105+
<plugin>
106+
<groupId>org.apache.maven.plugins</groupId>
107+
<artifactId>maven-surefire-plugin</artifactId>
108+
<version>3.0.0-M5</version>
109+
</plugin>
110+
<plugin>
111+
<groupId>org.apache.maven.plugins</groupId>
112+
<artifactId>maven-enforcer-plugin</artifactId>
113+
<version>3.0.0-M3</version>
114+
<executions>
115+
<execution>
116+
<id>enforce-maven</id>
117+
<goals>
118+
<goal>enforce</goal>
119+
</goals>
120+
<configuration>
121+
<rules>
122+
<requireMavenVersion>
123+
<version>3.5.4</version>
124+
</requireMavenVersion>
125+
<requireJavaVersion>
126+
<version>1.8</version>
127+
</requireJavaVersion>
128+
</rules>
129+
</configuration>
130+
</execution>
131+
</executions>
132+
</plugin>
133+
134+
<plugin>
135+
<groupId>org.apache.maven.plugins</groupId>
136+
<artifactId>maven-compiler-plugin</artifactId>
137+
<version>3.8.1</version>
138+
<configuration>
139+
<compilerId>eclipse</compilerId>
140+
<source>1.8</source>
141+
<target>1.8</target>
142+
</configuration>
143+
<dependencies>
144+
<dependency>
145+
<groupId>org.codehaus.plexus</groupId>
146+
<artifactId>plexus-compiler-eclipse</artifactId>
147+
<version>2.8.8</version>
148+
</dependency>
149+
</dependencies>
150+
</plugin>
151+
152+
<plugin>
153+
<groupId>org.codehaus.mojo</groupId>
154+
<artifactId>license-maven-plugin</artifactId>
155+
<version>2.0.0</version>
156+
157+
<executions>
158+
<execution>
159+
<id>first</id>
160+
<goals>
161+
<goal>update-file-header</goal>
162+
</goals>
163+
<phase>process-sources</phase>
164+
<configuration>
165+
<roots>
166+
<root>src/main/java</root>
167+
<root>src/test/java</root>
168+
</roots>
169+
</configuration>
170+
</execution>
171+
</executions>
172+
</plugin>
173+
174+
</plugins>
175+
</build>
176+
177+
</project>

src/main/java/sybase.png

689 Bytes
Loading
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
package xdev.db.sybase.jdbc;
2+
3+
4+
import java.sql.Connection;
5+
import java.util.Properties;
6+
7+
import com.xdev.jadoth.sqlengine.dbms.DbmsConnectionInformation;
8+
import xdev.db.ConnectionInformation;
9+
10+
11+
public class SybaseConnectionInformation extends ConnectionInformation<SybaseDbms>
12+
{
13+
// /////////////////////////////////////////////////////////////////////////
14+
// constructors //
15+
// ///////////////////
16+
17+
public SybaseConnectionInformation(final String host, final int port, final String user,
18+
final String password, final String database, final String urlExtension,
19+
final SybaseDbms dbmsAdaptor)
20+
{
21+
super(host,port,user,password,database,urlExtension,dbmsAdaptor);
22+
}
23+
24+
25+
// /////////////////////////////////////////////////////////////////////////
26+
// getters //
27+
// ///////////////////
28+
29+
/**
30+
* Gets the database.
31+
*
32+
* @return the database
33+
*/
34+
public String getDatabase()
35+
{
36+
return this.getCatalog();
37+
}
38+
39+
40+
// /////////////////////////////////////////////////////////////////////////
41+
// setters //
42+
// ///////////////////
43+
44+
/**
45+
* Sets the database.
46+
*
47+
* @param database
48+
* the database to set
49+
*/
50+
public void setDatabase(final String database)
51+
{
52+
this.setCatalog(database);
53+
}
54+
55+
56+
// /////////////////////////////////////////////////////////////////////////
57+
// override methods //
58+
// ///////////////////
59+
60+
/**
61+
* @see DbmsConnectionInformation#createJdbcConnectionUrl()
62+
*/
63+
@Override
64+
public String createJdbcConnectionUrl()
65+
{
66+
String url = "jdbc:sybase:Tds:" + getHost() + ":" + getPort() + "/" + getDatabase();
67+
return appendUrlExtension(url);
68+
}
69+
70+
71+
@Override
72+
protected Properties createConnectionProperties()
73+
{
74+
Properties p = super.createConnectionProperties();
75+
p.put("USE_METADATA","false");
76+
return p;
77+
}
78+
79+
80+
/**
81+
* @see DbmsConnectionInformation#getJdbcDriverClassName()
82+
*/
83+
@Override
84+
public String getJdbcDriverClassName()
85+
{
86+
return "com.sybase.jdbc3.jdbc.SybDriver";
87+
}
88+
89+
90+
@Override
91+
public boolean isConnectionValid(Connection connection)
92+
{
93+
try
94+
{
95+
return !connection.isClosed();
96+
}
97+
catch(Throwable ignored)
98+
{
99+
}
100+
101+
return false;
102+
}
103+
}

0 commit comments

Comments
 (0)