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
import de.dailab.jiactng.agentcore.action.AbstractMethodExposingBean; | |
public class HelloWorldExposingBean extends AbstractMethodExposingBean { | |
@Override | |
public void doInit() throws Exception { | |
super.doInit(); | |
} | |
@Override |
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
package examples.helloworld; | |
import de.dailab.jiactng.agentcore.AbstractAgentBean; | |
public class HelloWorldBean extends AbstractAgentBean { | |
@Override | |
public void doStart() throws Exception { | |
super.doStart(); | |
log.info("Starting Hello World Bean..."); |
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
/* This sql script checks if table with name TEST_TBL exists. | |
* The resultset of this query is column name '1' with one row, | |
* if the row contains a greate than '1' then the table exists. | |
* If it '0' the table doesn't exist. | |
* | |
*/ | |
select count(*) from SYS.SYSTABLES, SYS.SYSCOLUMNS | |
where SYS.SYSTABLES.TABLEID=SYS.SYSCOLUMNS.REFERENCEID | |
and SYS.SYSTABLES.TABLENAME = 'TEST_TBL'; |
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
import java.awt.*; | |
import java.awt.datatransfer.*; | |
public static void copyStringToClipboard(String s) { | |
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); | |
clipboard.setContents(new StringSelection(s), null); | |
} |
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
static void errorPrint(Throwable e) { | |
if (e instanceof SQLException) | |
SQLExceptionPrint((SQLException)e); | |
else | |
System.out.println("A non-SQL error: " + e.toString()); | |
} | |
static void SQLExceptionPrint(SQLException sqle) { | |
while (sqle != null) { | |
System.out.println("\n---SQLException Caught---\n"); |
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
import java.sql.*; | |
Connection connection = null; | |
String driver = "org.apache.derby.jdbc.EmbeddedDriver"; | |
String connectionURL = "jdbc:derby:" | |
connectionURL += my_db_path; | |
try { | |
// load driver |
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
# Back up from the command line (using mysqldump) | |
mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql] | |
# Back up the MySQL database | |
mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz] | |
# Restoring the MySQL database | |
mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql] |
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
package de.dailab.joda; | |
import java.text.SimpleDateFormat; | |
import java.util.TimeZone; | |
import org.joda.time.DateTime; | |
import org.joda.time.DateTimeZone; | |
import org.joda.time.Days; | |
import org.joda.time.Period; | |
import org.joda.time.format.PeriodFormatter; |
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
jps -l |
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
package example; | |
import java.beans.XMLEncoder; | |
import java.io.ByteArrayOutputStream; | |
import java.util.Vector; | |
public class XmlEncodeToString { | |
public static void main(String[] args) throws Exception { |
OlderNewer