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

Commit fa34cf0

Browse files
Update Readme and refactored MetaData
1 parent c4589d1 commit fa34cf0

File tree

2 files changed

+26
-47
lines changed

2 files changed

+26
-47
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ We once wrote this Database Adapter for Sybase 6.0. According to the following c
1212
The Maven Dependency (found on https://mvnrepository.com/artifact/com.esen.jdbc/sybase-jconn3/6.0 ), should not be used.
1313
In order to get this Adapter to run, you have to register on their website and manually download the JAR.
1414

15+
Furtermore, this Adapter is not applicable to write to the database. Your are only able to read from it.
16+
17+
The following actions, can't be performed:
18+
- createTable
19+
- addColumn
20+
- alterColumn
21+
- dropColumn
22+
- createIndex
23+
- dropIndex
24+
- appendEscapeName
25+
1526
## XDEV-IDE
1627
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.
1728

src/main/java/xdev/db/sybase/jdbc/SybaseJDBCMetaData.java

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private static void fillIndicies(Map<IndexInfo, Set<String>> indexMap, Index[] i
217217
indices[i] = new Index(indexInfo.name, indexInfo.type,indexColumns);
218218
}
219219

220-
private static void putColumnNamesInIndexMap(ResultSet rs, Map<IndexInfo, Set<String>> indexMap, Set<String> primaryKeyColumns)
220+
private void putColumnNamesInIndexMap(ResultSet rs, Map<IndexInfo, Set<String>> indexMap, Set<String> primaryKeyColumns)
221221
throws SQLException
222222
{
223223
String indexName = rs.getString("INDEX_NAME");
@@ -271,9 +271,6 @@ private void fillColumnsMetaData(
271271
column.isAutoIncrement());
272272
}
273273

274-
// XXX not able to get return type of procedures and remarks for all. maybe
275-
// getting answer of my question in the forum:
276-
// http://www.dbforums.com/sybase/1693489-how-get-stored-procedure-function-infos.html
277274
@Override
278275
public StoredProcedure[] getStoredProcedures(ProgressMonitor monitor) throws DBException
279276
{
@@ -330,18 +327,7 @@ public StoredProcedure[] getStoredProcedures(ProgressMonitor monitor) throws DBE
330327
}
331328
else if(columnType==2)
332329
{
333-
paramType = Par
334-
}
335-
switch(columnType)
336-
{
337-
case 1:
338-
paramType = ParamType.IN;
339-
break;
340-
case 2:
341-
paramType = ParamType.OUT;
342-
break;
343-
default:
344-
break;
330+
paramType = ParamType.OUT;
345331
}
346332
}
347333

@@ -379,7 +365,6 @@ else if(columnType==2)
379365
);
380366
spIndex++;
381367
oldName = name;
382-
383368
}
384369
}
385370
}
@@ -398,74 +383,57 @@ else if(columnType==2)
398383

399384
private DataType sybToJdbc(int dataType, int userType)
400385
{
401-
// Check following side to add or change parsing DataTypes.
402-
// http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.tables/html/tables/tables46.htm
403386
switch(dataType)
404387
{
405388
case 48:
406389
return DataType.TINYINT;
390+
407391
case 52:
408392
return DataType.SMALLINT;
393+
409394
case 56:
410395
return DataType.INTEGER;
396+
411397
case 191:
412398
return DataType.BIGINT;
413399

414400
case 62:
415401
return DataType.FLOAT;
402+
416403
case 59:
417404
return DataType.REAL;
418-
// case Types.DOUBLE:
419-
// return DataType.DOUBLE;
405+
420406
case 63:
421407
return DataType.NUMERIC;
408+
422409
case 55:
423410
return DataType.DECIMAL;
424411

425412
case 50:
426413
return DataType.BOOLEAN;
427414

428415
case 47:
429-
// case Types.NCHAR:
430416
return DataType.CHAR;
431-
case 39:
432-
// case Types.NVARCHAR:
433-
return DataType.VARCHAR;
434-
// case Types.LONGVARCHAR:
435-
// case Types.LONGNVARCHAR:
436-
// return DataType.LONGVARCHAR;
417+
437418
case 35:
438-
// case Types.CLOB:
439-
// case Types.NCLOB:
440419
return DataType.CLOB;
441420

442421
case 45:
443422
return DataType.BINARY;
423+
444424
case 37:
445-
switch(userType)
425+
if(userType == 80)
446426
{
447-
case 4:
448-
return DataType.VARBINARY;
449-
case 80:
450-
return DataType.TIMESTAMP;
451-
default:
452-
return DataType.VARBINARY;
453-
427+
return DataType.TIMESTAMP;
454428
}
455-
// case Types.LONGVARBINARY:
456-
// return DataType.LONGVARBINARY;
457-
// case Types.BLOB:
458-
// return DataType.BLOB;
459-
429+
return DataType.VARBINARY;
430+
460431
case 49:
461432
return DataType.DATE;
462433

463434
case 51:
464435
return DataType.TIME;
465-
466-
// case Types.TIMESTAMP:
467-
// return DataType.TIMESTAMP;
468-
436+
469437
default:
470438
return DataType.VARCHAR;
471439
}

0 commit comments

Comments
 (0)