Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.coal.core;
- /**@author Adil */
- /***
- * Credits and fanfares:
- * Myrax(Dominic) - :D
- * Mike (office.boy/Demilium) & Nillus (Nils) - Blunk (reference)
- */
- /**@version 0.1 */
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.sql.SQLException;
- import java.util.Properties;
- import com.coal.net.*;
- import com.coal.storage.*;
- ;/** Class where all our methods are called */
- public class CoalEnvironment {
- public static Properties conf;
- public static void config(){
- Properties conf = new Properties();
- try {
- //set the properties value
- conf.setProperty("url","http://localhost");
- conf.setProperty("database", "bittybay");
- conf.setProperty("dbuser", "root");
- conf.setProperty("dbpassword", "asd");
- //save properties to project root folder
- conf.store(new FileOutputStream("coal.properties"), null);
- //let's write now
- } catch (IOException ex) {
- ex.printStackTrace();
- }
- }
- public static void writeconf(){
- }
- public static void main(String[] args) throws SQLException {
- System.out.println();
- System.out.println("#########################################");
- System.out.println("## Coal:Simple Emulation Environment ##");
- System.out.println("## Copyright (C) 2011 ##");
- System.out.println("## Adil ##");
- System.out.println("## JokerCode.NET ##");
- System.out.println("#########################################");
- System.out.println("Initializing core objects...");
- socket.getIP();
- System.out.println("Connecting on port:" + socket.getsocket());
- socket.serversocket(socket.getsocket());
- System.out.println("Socket connection established!");
- System.out.println("Preparing to set up TCP environment....");
- socket.setTCP();
- Storage.jdbcheck();
- try {
- //load a properties file
- conf.load(new FileInputStream("coal.properties"));
- //get the property value and print it out
- System.out.println(conf.getProperty("database"));
- System.out.println(conf.getProperty("dbuser"));
- System.out.println(conf.getProperty("dbpassword"));
- } catch (IOException ex) {
- ex.printStackTrace();
- }
- Storage.bonecon();
- }}
Advertisement
Add Comment
Please, Sign In to add comment