# HG changeset patch # User František Kučera # Date 1262360686 -3600 # Node ID 5816c7f61a2a88272b0ff343f7a37b5f5d07ad1a # Parent d40099dbbdd1a00cf96c0a04d4db4f4eb6555a4c Skript pro spouštění a hesla k DB. diff -r d40099dbbdd1 -r 5816c7f61a2a .hgignore --- a/.hgignore Thu Dec 31 18:41:04 2009 +0100 +++ b/.hgignore Fri Jan 01 16:44:46 2010 +0100 @@ -2,3 +2,4 @@ java/abc-drupal-gui/build/* java/abc-drupal-gui/nbproject/private/* java/abc-drupal-gui/lib/* +java/abc-drupal-gui/hesla.sh diff -r d40099dbbdd1 -r 5816c7f61a2a java/abc-drupal-gui/src/cz/frantovo/abcDrupal/Konvertor.java --- a/java/abc-drupal-gui/src/cz/frantovo/abcDrupal/Konvertor.java Thu Dec 31 18:41:04 2009 +0100 +++ b/java/abc-drupal-gui/src/cz/frantovo/abcDrupal/Konvertor.java Fri Jan 01 16:44:46 2010 +0100 @@ -1,5 +1,8 @@ package cz.frantovo.abcDrupal; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; import java.util.Date; /** @@ -8,9 +11,11 @@ */ public class Konvertor { + private PosluchacLogu posluchacLogu; private String jdbcZdroj; private String jdbcCil; - private PosluchacLogu posluchacLogu; + private Connection dbZdroj; + private Connection dbCil; public Konvertor(String jdbcZdroj, String jdbcCil, PosluchacLogu posluchacLogu) { this.jdbcZdroj = jdbcZdroj; @@ -20,8 +25,17 @@ public void konvertuj() { vypis("Začíná migrace"); + + + + vypis("Migrace dokončena"); } + + private void nastavDBspojeni() throws SQLException { + dbZdroj = DriverManager.getConnection(""); + } + private void vypis(String zprava) { if (posluchacLogu != null) { diff -r d40099dbbdd1 -r 5816c7f61a2a java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.form --- a/java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.form Thu Dec 31 18:41:04 2009 +0100 +++ b/java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.form Fri Jan 01 16:44:46 2010 +0100 @@ -38,7 +38,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -79,12 +79,12 @@ - + - + @@ -104,12 +104,12 @@ - + - + diff -r d40099dbbdd1 -r 5816c7f61a2a java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.java --- a/java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.java Thu Dec 31 18:41:04 2009 +0100 +++ b/java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.java Fri Jan 01 16:44:46 2010 +0100 @@ -25,6 +25,7 @@ /** Creates new form HlavniOkno */ public HlavniOkno() { initComponents(); + setLocationRelativeTo(null); nactiPromenneProstredi(); } @@ -54,7 +55,7 @@ jdbcCil = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); vystup = new javax.swing.JTextArea(); - jButton1 = new javax.swing.JButton(); + nahratData = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("ABC-Drupal"); @@ -63,9 +64,9 @@ jLabel2.setText("Cíl"); - jdbcZdroj.setText("jdbcZdroj"); + jdbcZdroj.setText("jdbc:mysql://127.0.0.1:3306/itbiz?user=itbiz&password=nbusr123"); - jdbcCil.setText("jdbcCil"); + jdbcCil.setText("jdbc:mysql://127.0.0.1:3306/abclinuxu?user=abclinuxu&password=nbusr123"); vystup.setColumns(20); vystup.setEditable(false); @@ -73,10 +74,10 @@ vystup.setEnabled(false); jScrollPane1.setViewportView(vystup); - jButton1.setText("Nahrát data"); - jButton1.addActionListener(new java.awt.event.ActionListener() { + nahratData.setText("Nahrát data"); + nahratData.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(evt); + nahratDataActionPerformed(evt); } }); @@ -96,7 +97,7 @@ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jdbcCil, javax.swing.GroupLayout.DEFAULT_SIZE, 560, Short.MAX_VALUE) .addComponent(jdbcZdroj, javax.swing.GroupLayout.DEFAULT_SIZE, 560, Short.MAX_VALUE))) - .addComponent(jButton1)) + .addComponent(nahratData)) .addContainerGap()) ); layout.setVerticalGroup( @@ -113,17 +114,17 @@ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton1) + .addComponent(nahratData) .addContainerGap()) ); pack(); }// //GEN-END:initComponents - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + private void nahratDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nahratDataActionPerformed Konvertor k = new Konvertor(jdbcZdroj.getText(), jdbcCil.getText(), this); k.konvertuj(); - }//GEN-LAST:event_jButton1ActionPerformed + }//GEN-LAST:event_nahratDataActionPerformed /** * @param args the command line arguments @@ -147,12 +148,12 @@ } } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextField jdbcCil; private javax.swing.JTextField jdbcZdroj; + private javax.swing.JButton nahratData; private javax.swing.JTextArea vystup; // End of variables declaration//GEN-END:variables diff -r d40099dbbdd1 -r 5816c7f61a2a java/abc-drupal-gui/start.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/abc-drupal-gui/start.sh Fri Jan 01 16:44:46 2010 +0100 @@ -0,0 +1,9 @@ +#!/bin/bash + +# Soubor obsahující hesla k DB – nastavuje níže uvedené proměnné +source hesla.sh; +# MIGRACE_ZDROJ="jdbc:mysql://127.0.0.1:3306/itbiz?user=itbiz&password=nbusr123"; +# MIGRACE_ZDROJ="jdbc:mysql://127.0.0.1:3306/itbiz?user=itbiz&password=nbusr123"; + +cd dist; +java -jar abc-drupal-gui.jar;