Examples of MysqlDataSource


Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

                    serviceReg.unregister();
                } catch (Exception e) {
                }
                serviceReg = null;
            }
            MysqlDataSource ds = new MysqlDataSource();
            ds.setUrl(getString("url", properties));
            ds.setUser(getString("user", properties));
            ds.setPassword(getString("password", properties));

            Dictionary<String, String> regProperties = new Hashtable<String, String>();
            regProperties.put("osgi.jndi.service.name" , getString("name", properties));
            serviceReg = context.registerService(DataSource.class, ds, regProperties);
        }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

    String user = "root";
    String password = "";

    public Connection getConnection() {
        if (connection == null) {
            MysqlDataSource dataSource = new MysqlDataSource();
            dataSource.setUrl(url);
            dataSource.setUser(user);
            dataSource.setPassword(password);
            try {
                connection = dataSource.getConnection();
            } catch (SQLException e) {
                System.out.println("Koneksi mysql gagal! \n Error: " + e.getMessage());
            }
        }
        return connection;
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

    String user = "root";
    String password = "";

    public Connection getConnection() {
        if (connection == null) {
            MysqlDataSource dataSource = new MysqlDataSource();
            dataSource.setUrl(url);
            dataSource.setUser(user);
            dataSource.setPassword(password);
            try {
                connection = dataSource.getConnection();
            } catch (SQLException e) {
                System.out.println("Koneksi mysql gagal! \n Error: " + e.getMessage());
            }
        }
        return connection;
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

    }

    public void run( IProgressMonitor monitor ) throws InvocationTargetException,
            InterruptedException {
     
        MysqlDataSource ds = new MysqlDataSource();
        ds.setServerName(host);
        ds.setPort(port);
        ds.setDatabaseName("mysql"); //$NON-NLS-1$
        ds.setUser(username);
        ds.setPassword(password);
       
        DriverManager.setLoginTimeout(3);

        try {
            Connection connection = ds.getConnection();
            try {
               
                // TODO check that geometryColumns is accessible
              ResultSet rs = connection.getMetaData().getCatalogs();
              while(rs.next()){
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

    }

    public void run( IProgressMonitor monitor ) {
        //MySQLConnectionFactory conFac = new MySQLConnectionFactory(host, port, database);
        //conFac.setLogin(username, password);
        MysqlDataSource ds = new MysqlDataSource();
        ds.setServerName(host);
        ds.setPort(port);
        ds.setDatabaseName(database);
        ds.setUser(username);
        ds.setPassword(password);
        DriverManager.setLoginTimeout(3);

        try {
            loadTableDescriptrs(ds);
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

public class DBAccess {
 
  public static MysqlDataSource ReturnDataSource()
  {
    MysqlDataSource dataSource = new MysqlDataSource();
    dataSource.setServerName("localhost");
    dataSource.setUser("sourceforge");
      dataSource.setPassword("dont4get");
      dataSource.setDatabaseName("sourceforge");
      dataSource.setPort(3306);
     
      return dataSource;
  }
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

      return dataSource;
  }
 
  public Boolean save(String i_query)
  {
      MysqlDataSource l_ds = DBAccess.ReturnDataSource();
      Connection l_con = null;
      Statement l_stat = null;
     
      int l_anz = 0;
      try

      {
        l_con = l_ds.getConnection();
      l_stat = l_con.createStatement()

       
      l_stat.execute(i_query);
   
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

  private final static DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
 
  public Artifact(long artifact_id, boolean dummy)
  {
 
    MysqlDataSource l_ds = DBAccess.ReturnDataSource();
      Connection l_con = null;
      Statement l_stat = null;
     
      try
      {
        l_con = l_ds.getConnection();
      l_stat = l_con.createStatement()

       
      ResultSet s = l_stat.executeQuery("select artifact_id, group_artifact_id, status_id, category_id, artifact_group_id," +
          " resolution_id, priority, submitted_by, assigned_to, from_unixtime(open_date) as open_date, from_unixtime(close_date) as close_date, " +
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

    m_group_artifact_id = group_artifact_id;
  }
 
  public static LinkedList<Long> getArtifacts(long group_artifact_id, Date begin, Date end)
  {
    MysqlDataSource l_ds = DBAccess.ReturnDataSource();
      Connection l_con = null;
      Statement l_stat = null;
      LinkedList<Long> l_artifact_ids = new LinkedList<Long>();
     
      try
      {
        l_con = l_ds.getConnection();
      l_stat = l_con.createStatement()

       
      ResultSet s = l_stat.executeQuery("select artifact_id from artifact where group_artifact_id = " + group_artifact_id + " and from_unix_time(open_date) > '"
          + df.format(begin) + "' and from_unix_time(close_date) < '" + df.format(begin) + "'");
View Full Code Here

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSource

      return l_artifact_ids;
  }
 
  public static LinkedList<Long> getArtifacts(long group_artifact_id)
  {
    MysqlDataSource l_ds = DBAccess.ReturnDataSource();
      Connection l_con = null;
      Statement l_stat = null;
      LinkedList<Long> l_artifact_ids = new LinkedList<Long>();
     
      try
      {
        l_con = l_ds.getConnection();
      l_stat = l_con.createStatement()

       
      ResultSet s = l_stat.executeQuery("select artifact_id from artifact where group_artifact_id = " + group_artifact_id);
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.