This file contains hidden or 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
| //Insert Customer using Direct T-SQL Statement | |
| private void btnDirectSql_Click(object sender, EventArgs e) | |
| { | |
| const string ConnStr = | |
| // "Data Source=localhost;Initial Catalog=SampleDb;Integrated Security=true;"; | |
| "Data Source=(localdb)\\Projects;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;Initial Catalog=SampleDb;"; | |
| const string TSql = | |
| "INSERT INTO Customer (FirstName, LastName) VALUES ('Lukas', 'Keller')"; |
This file contains hidden or 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
| DECLARE @line geometry = 'LINESTRING(5 15,22 10)' | |
| select @line AS AsRaw, @line.ToString() AS AsWKT | |
| GO |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <kml xmlns="http://earth.google.com/kml/2.1"> | |
| <Document> | |
| <name>KML Name</name> | |
| <description>KML Description</description> | |
| <Style id="style1"> | |
| <LineStyle> | |
| <color>990000ff</color> | |
| <width>4</width> | |
| </LineStyle> |
This file contains hidden or 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
| public class Time2 { | |
| private int hour; //0-23 | |
| private int minute; //0-59 | |
| private int second; //0-59 | |
| //set a new time value using universal time; ensure that | |
| //the data remains consistent by setting invalid values to zero | |
| public Time2() | |
| { | |
| this(0, 0, 0); |
This file contains hidden or 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 org.apache.log4j.Logger; | |
| import org.apache.log4j.BasicConfigurator; | |
| public class TestLog4j { | |
| static Logger logger = Logger.getLogger("JTST"); | |
| public static void main(String[] args) { | |
| // TODO Auto-generated method stub | |
| try |
This file contains hidden or 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
| # An addition | |
| 5 + 5 | |
| # A subtraction | |
| 5 - 5 | |
| # A multiplication | |
| 3 * 5 | |
| # A division |
This file contains hidden or 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 com.javademo; | |
| import java.io.FileNotFoundException; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.util.Properties; | |
| public class PropertiesDemo { | |
| public static void main(String[] args) { |
This file contains hidden or 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 main; | |
| import java.sql.Connection; | |
| import java.sql.ResultSet; | |
| import java.sql.SQLException; | |
| import java.sql.Statement; | |
| import java.util.Properties; | |
| import md.java.db.DBConnectionUtils; | |
| import md.java.io.ReadProperties; |
This file contains hidden or 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
| MongoClient mongoClient = new MongoClient( "localhost" , 27017 ); | |
| MongoDatabase database = mongoClient.getDatabase("mydb"); | |
| collection = database.getCollection("people"); |
This file contains hidden or 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
| //Insert three famous person documents | |
| //Top 3 from http://www.biographyonline.net/people/famous-100.html | |
| Document person1 = new Document("First Name", "Marilyn") | |
| .append("Last Name", "Monroe"); | |
| Document person2 = new Document("First Name", "Abraham") | |
| .append("Last Name", "Lincoln"); | |
| Document person3 = new Document("First Name", "Mother") | |
| .append("Last Name", "Teresa"); |