Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 96edfe4
Showing
5 changed files
with
1,448 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.DS_Store | ||
bin/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
# javac -d bin src/xep/samples/*.java | ||
|
||
# sourcepath: reference the other source files e.g. Core.java | ||
# classpath: reference the class files and libraries e.g. class and jar extensions | ||
# javac -d bin -sourcepath src -classpath bin:$CLASSPATH src/xep/test/Basic.java | ||
javac -d bin -classpath bin:$CLASSPATH src/BindingExamples.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
java -classpath bin:$CLASSPATH BindingExamples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import koorong.*; | ||
import java.sql.*; | ||
import com.intersys.objects.*; | ||
|
||
public class BindingExamples { | ||
public static void main(String[] args){ | ||
try { | ||
Database db = getDatabase(); | ||
System.out.println("\nConnected to DB... "); | ||
|
||
CreateBlankBook(db); | ||
CreateBook(db); | ||
} | ||
catch (Exception ex) { | ||
System.out.println("Caught exception: " + ex.getClass().getName() + ": " + ex.getMessage()); | ||
} | ||
} | ||
|
||
public static Database getDatabase() throws CacheException{ | ||
String url="jdbc:Cache://localhost:56121/USER"; | ||
String username="_SYSTEM"; | ||
String pwd="SYS"; | ||
Database db = CacheDatabase.getDatabase(url, username, pwd); | ||
return db; | ||
} | ||
|
||
public static void CreateBlankBook(Database db) { | ||
try { | ||
Book book = new Book(db); | ||
System.out.println("Created new Book... "); | ||
|
||
int success = book.save(); | ||
System.out.println("Saved Book... "); | ||
} | ||
catch (Exception ex) { | ||
System.out.println("Caught exception: " + ex.getClass().getName() + ": " + ex.getMessage()); | ||
} | ||
} | ||
|
||
// CreateBook (com.intersys.objects.Database db, java.util.List tags) throws com.intersys.objects.CacheException { | ||
public static void CreateBook(Database db) { | ||
try { | ||
CreateBook(db); | ||
System.out.println("Called CreateBook function... "); | ||
} | ||
catch (Exception ex) { | ||
System.out.println("Caught exception: " + ex.getClass().getName() + ": " + ex.getMessage()); | ||
} | ||
} | ||
} |
Oops, something went wrong.