Profile

Cover photo
Brandon Fischer
Works at Rosedale Union School District
Attends Rogue Community College
Lives in Bakersfield CA
17 followers|269,545 views
AboutPostsPhotosYouTube

Stream

 
Check out this video on YouTube:
1
Add a comment...

Brandon Fischer

Shared publicly  - 
1
Add a comment...

Brandon Fischer

Discussion  - 
 
Can anyone help me figure how to get this code to display correctly in a JTextArea? I'm using JDBC, we are able to get the code to send over the string buffer to the main class but the format will not display correctly. The first column will display straight as well as the second but after that the format is all sloppy. The strange thing is that we checked the code output into the command line output area and it will format it correctly when you display it in that area but not in the text area. If anyone can help that would be amazing! 

package pkgfinal;
import java.sql.*;

public class connectURL {
    // Declare the JDBC objects.
private Connection con = null;
private Statement stmt = null;
private ResultSet rs = null;
private String URLQuery;
private ResultSetMetaData rsmd;
private StringBuffer sbf;

 public connectURL(String queryString) throws Exception{
              sbf = new StringBuffer();
            //  sbf.delete(0, sbf.length());
                // URLQuery = query;
// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=Final;integratedSecurity=true;";

       
        // Establish the connection.
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(connectionUrl);
            String t =queryString;
            // Create and execute an SQL statement that returns some data.
            stmt = con.createStatement();
                       
            rs = stmt.executeQuery(t);
                        rsmd = rs.getMetaData();
       
            int columnCount = rsmd.getColumnCount ();
            String[] columnLabels = new String[columnCount];
            int[] columnWidths = new int[columnCount];
            for (int i = 1; i <= columnCount; ++i) { 
                columnLabels[i-1] = rsmd.getColumnLabel (i);
                columnWidths[i-1] = Math.max (columnLabels[i-1].length(),
                                              rsmd.getColumnDisplaySize (i)+10);
            }           
                             
                  // Output the column headings.
            for (int i = 1; i <= columnCount; ++i) {
                 sbf.append(format (rsmd.getColumnLabel(i), columnWidths[i-1] ));
                 sbf.append("\t");
                 
            }           
                  sbf.append("\n");           
                // Output a dashed line.
            StringBuffer dashedLine;
            for (int i = 1; i <= columnCount; ++i) {
                for (int j = 1; j <= columnWidths[i-1]; ++j)
                    
                 sbf.append("-");
                 sbf.append("  \t");
                 
            }
                  sbf.append("\n");   
                       
              // Iterate throught the rows in the result set and output
            // the columns for each row. 
            while (rs.next ()) {
                for (int i = 1; i <= columnCount; ++i) {
                    String value = rs.getString (i);
                    if (rs.wasNull ())
                        value = "<null>";
                     sbf.append(format (value, columnWidths[i-1]));
                     sbf.append("     \t \t \t        ");
                }
                sbf.append("\n");
            }      
            
}
       public String toString(){
      
         return  sbf.toString();     
       }  

  // Format a string so that it has the specified width.
  
       private static String format (String s, int width)
    {
        String formattedString;

        // The string is shorter than specified width,
        // so we need to pad with blanks.
        if (s.length() < width) {
            StringBuffer buffer = new StringBuffer (s);
            for (int i = s.length(); i < width; ++i)
                buffer.append (" ");
            formattedString = buffer.toString();
        }

        // Otherwise, we need to truncate the string.
        else
            formattedString = s.substring (0, width);

        return formattedString;
    }
         
}
1
Brandon Fischer's profile photo
 
Figured it out! Thanks. Just changed the font to MONOSPACED. For some reason those other fonts mess up the format output. 
Add a comment...

Brandon Fischer

commented on a video on YouTube.
Shared publicly  - 
 
Thanks! Best video that I could find. 
1
Brandon Fischer's profile photo
 
By the way you sound like Vince Vaughn.
Add a comment...
 
This video will show you how to connect to a local database Microsoft SQL server database using Java and the NetBeans IDE.
1
Add a comment...
In his circles
49 people
Have him in circles
17 people
Danuja Dabare's profile photo
Ellie Fischer's profile photo
Kris Wenzel's profile photo
D'kyn Fehr's profile photo
ITMaple.com's profile photo
override1960's profile photo
BARRY JOANS's profile photo
amber mccormick's profile photo
eric arriaga's profile photo

Brandon Fischer

SysAdmin\NetAdmin  - 
 
 Does anyone have a moment to answer some questions about group policies and pushing .MSI files out for adobe reader? 
1
Brandon Fischer's profile photoMichael Steadman's profile photoMatthew Cobley's profile photoJosh Frye's profile photo
8 comments
 
Sign up for a Adobe distribution license, when I find the URL for the sign up I will make a main post to share with everyone. The sad thing about Adobe reader is you will get a exe file, not a msi file.
Last time I did some experimenting on trying to make a package for Adobe reader, you had to use their software to make a custom package. I got disgusted and handed everything I had off to our SCCM specialist. So I am not sure how he or the SCCM group is doing it right now.
Add a comment...

Brandon Fischer

Dev\Code\Script  - 
 
Can anyone help me figure how to get this code to display correctly in a JTextArea? I'm using JDBC, we are able to get the code to send over the string buffer to the main class but the format will not display correctly. The first column will display straight as well as the second but after that the format is all sloppy. The strange thing is that we checked the code output into the command line output area and it will format it correctly when you display it in that area but not in the text area. If anyone can help that would be amazing! 

package pkgfinal;
import java.sql.*;

public class connectURL {
    // Declare the JDBC objects.
private Connection con = null;
private Statement stmt = null;
private ResultSet rs = null;
private String URLQuery;
private ResultSetMetaData rsmd;
private StringBuffer sbf;

 public connectURL(String queryString) throws Exception{
              sbf = new StringBuffer();
            //  sbf.delete(0, sbf.length());
                // URLQuery = query;
// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=Final;integratedSecurity=true;";

       
        // Establish the connection.
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(connectionUrl);
            String t =queryString;
            // Create and execute an SQL statement that returns some data.
            stmt = con.createStatement();
                       
            rs = stmt.executeQuery(t);
                        rsmd = rs.getMetaData();
       
            int columnCount = rsmd.getColumnCount ();
            String[] columnLabels = new String[columnCount];
            int[] columnWidths = new int[columnCount];
            for (int i = 1; i <= columnCount; ++i) { 
                columnLabels[i-1] = rsmd.getColumnLabel (i);
                columnWidths[i-1] = Math.max (columnLabels[i-1].length(),
                                              rsmd.getColumnDisplaySize (i)+10);
            }           
                             
                  // Output the column headings.
            for (int i = 1; i <= columnCount; ++i) {
                 sbf.append(format (rsmd.getColumnLabel(i), columnWidths[i-1] ));
                 sbf.append("\t");
                 
            }           
                  sbf.append("\n");           
                // Output a dashed line.
            StringBuffer dashedLine;
            for (int i = 1; i <= columnCount; ++i) {
                for (int j = 1; j <= columnWidths[i-1]; ++j)
                    
                 sbf.append("-");
                 sbf.append("  \t");
                 
            }
                  sbf.append("\n");   
                       
              // Iterate throught the rows in the result set and output
            // the columns for each row. 
            while (rs.next ()) {
                for (int i = 1; i <= columnCount; ++i) {
                    String value = rs.getString (i);
                    if (rs.wasNull ())
                        value = "<null>";
                     sbf.append(format (value, columnWidths[i-1]));
                     sbf.append("     \t \t \t        ");
                }
                sbf.append("\n");
            }      
            
}
       public String toString(){
      
         return  sbf.toString();     
       }  

  // Format a string so that it has the specified width.
  
       private static String format (String s, int width)
    {
        String formattedString;

        // The string is shorter than specified width,
        // so we need to pad with blanks.
        if (s.length() < width) {
            StringBuffer buffer = new StringBuffer (s);
            for (int i = s.length(); i < width; ++i)
                buffer.append (" ");
            formattedString = buffer.toString();
        }

        // Otherwise, we need to truncate the string.
        else
            formattedString = s.substring (0, width);

        return formattedString;
    }
         
}
1
skooter Martin's profile photoBrandon Fischer's profile photo
10 comments
 
It's java II at my college. 
Add a comment...
 
Can anyone help me figure how to get this code to display correctly in a JTextArea? I'm using JDBC, we are able to get the code to send over the string buffer to the main class but the format will not display correctly. The first column will display straight as well as the second but after that the format is all sloppy. The strange thing is that we checked the code output into the command line output area and it will format it correctly when you display it in that area but not in the text area. If anyone can help that would be amazing! 

package pkgfinal;
import java.sql.*;

public class connectURL {
    // Declare the JDBC objects.
private Connection con = null;
private Statement stmt = null;
private ResultSet rs = null;
private String URLQuery;
private ResultSetMetaData rsmd;
private StringBuffer sbf;

 public connectURL(String queryString) throws Exception{
              sbf = new StringBuffer();
            //  sbf.delete(0, sbf.length());
                // URLQuery = query;
// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=Final;integratedSecurity=true;";

       
        // Establish the connection.
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(connectionUrl);
            String t =queryString;
            // Create and execute an SQL statement that returns some data.
            stmt = con.createStatement();
                       
            rs = stmt.executeQuery(t);
                        rsmd = rs.getMetaData();
       
            int columnCount = rsmd.getColumnCount ();
            String[] columnLabels = new String[columnCount];
            int[] columnWidths = new int[columnCount];
            for (int i = 1; i <= columnCount; ++i) { 
                columnLabels[i-1] = rsmd.getColumnLabel (i);
                columnWidths[i-1] = Math.max (columnLabels[i-1].length(),
                                              rsmd.getColumnDisplaySize (i)+10);
            }           
                             
                  // Output the column headings.
            for (int i = 1; i <= columnCount; ++i) {
                 sbf.append(format (rsmd.getColumnLabel(i), columnWidths[i-1] ));
                 sbf.append("\t");
                 
            }           
                  sbf.append("\n");           
                // Output a dashed line.
            StringBuffer dashedLine;
            for (int i = 1; i <= columnCount; ++i) {
                for (int j = 1; j <= columnWidths[i-1]; ++j)
                    
                 sbf.append("-");
                 sbf.append("  \t");
                 
            }
                  sbf.append("\n");   
                       
              // Iterate throught the rows in the result set and output
            // the columns for each row. 
            while (rs.next ()) {
                for (int i = 1; i <= columnCount; ++i) {
                    String value = rs.getString (i);
                    if (rs.wasNull ())
                        value = "<null>";
                     sbf.append(format (value, columnWidths[i-1]));
                     sbf.append("     \t \t \t        ");
                }
                sbf.append("\n");
            }      
            
}
       public String toString(){
      
         return  sbf.toString();     
       }  

  // Format a string so that it has the specified width.
  
       private static String format (String s, int width)
    {
        String formattedString;

        // The string is shorter than specified width,
        // so we need to pad with blanks.
        if (s.length() < width) {
            StringBuffer buffer = new StringBuffer (s);
            for (int i = s.length(); i < width; ++i)
                buffer.append (" ");
            formattedString = buffer.toString();
        }

        // Otherwise, we need to truncate the string.
        else
            formattedString = s.substring (0, width);

        return formattedString;
    }
         
}
1
Brandon Fischer's profile photo
 
Figured it out! Thanks. Just changed the font to MONOSPACED. For some reason those other fonts mess up the format output. 
Add a comment...

Brandon Fischer

Discussion  - 
 
Can anyone help me figure how to get this code to display correctly in a JTextArea? I'm using JDBC, we are able to get the code to send over the string buffer to the main class but the format will not display correctly. The first column will display straight as well as the second column in the JTextArea but after that the format is all sloppy. The strange thing is that we checked the code output into the command line output area and it will format it correctly when you display it in that area but not in the text area. If anyone can help that would be amazing! 

package pkgfinal;
import java.sql.*;

public class connectURL {
    // Declare the JDBC objects.
private Connection con = null;
private Statement stmt = null;
private ResultSet rs = null;
private String URLQuery;
private ResultSetMetaData rsmd;
private StringBuffer sbf;

 public connectURL(String queryString) throws Exception{
              sbf = new StringBuffer();
            //  sbf.delete(0, sbf.length());
                // URLQuery = query;
// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=Final;integratedSecurity=true;";

       
        // Establish the connection.
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(connectionUrl);
            String t =queryString;
            // Create and execute an SQL statement that returns some data.
            stmt = con.createStatement();
                       
            rs = stmt.executeQuery(t);
                        rsmd = rs.getMetaData();
       
            int columnCount = rsmd.getColumnCount ();
            String[] columnLabels = new String[columnCount];
            int[] columnWidths = new int[columnCount];
            for (int i = 1; i <= columnCount; ++i) { 
                columnLabels[i-1] = rsmd.getColumnLabel (i);
                columnWidths[i-1] = Math.max (columnLabels[i-1].length(),
                                              rsmd.getColumnDisplaySize (i)+10);
            }           
                             
                  // Output the column headings.
            for (int i = 1; i <= columnCount; ++i) {
                 sbf.append(format (rsmd.getColumnLabel(i), columnWidths[i-1] ));
                 sbf.append("\t");
                 
            }           
                  sbf.append("\n");           
                // Output a dashed line.
            StringBuffer dashedLine;
            for (int i = 1; i <= columnCount; ++i) {
                for (int j = 1; j <= columnWidths[i-1]; ++j)
                    
                 sbf.append("-");
                 sbf.append("  \t");
                 
            }
                  sbf.append("\n");   
                       
              // Iterate throught the rows in the result set and output
            // the columns for each row. 
            while (rs.next ()) {
                for (int i = 1; i <= columnCount; ++i) {
                    String value = rs.getString (i);
                    if (rs.wasNull ())
                        value = "<null>";
                     sbf.append(format (value, columnWidths[i-1]));
                     sbf.append("     \t \t \t        ");
                }
                sbf.append("\n");
            }      
            
}
       public String toString(){
      
         return  sbf.toString();     
       }  

  // Format a string so that it has the specified width.
  
       private static String format (String s, int width)
    {
        String formattedString;

        // The string is shorter than specified width,
        // so we need to pad with blanks.
        if (s.length() < width) {
            StringBuffer buffer = new StringBuffer (s);
            for (int i = s.length(); i < width; ++i)
                buffer.append (" ");
            formattedString = buffer.toString();
        }

        // Otherwise, we need to truncate the string.
        else
            formattedString = s.substring (0, width);

        return formattedString;
    }
         
}
1
Blow it Up Gaming's profile photoBrandon Fischer's profile photoMarco Dörfliger's profile photo
3 comments
 
Yeah you need to use a fixed-width font. 
Add a comment...

Brandon Fischer

Service Questions  - 
 
Has anyone had this problem before? It feels like it's locking up on one side and the tires are skidding when I put the truck in 4Lo or 4ish. The damn wheels feel like they are going to fall off on that side. 
3
Add a comment...
 
Can anyone help me? I'm  trying to make a front end Java program that connects to my Microsoft SQL server 2012 database. Everything I'm finding online needs me to connect the the server through internet or use JDBC, which again I think you need to connect through a server online.  
1
Brandon Fischer's profile photoNeil L's profile photo
29 comments
Neil L
 
Looking forward to the video ;-)
Add a comment...

Brandon Fischer

commented on a video on YouTube.
Shared publicly  - 
 
What IDE is he using? 
1
Trevor Page's profile photoBrandon Fischer's profile photo
2 comments
 
I've been using net beans and this looks legit. It makes your set and get method for you!? That's awesome. That will save me some fat finger time. Lol 
Add a comment...
People
In his circles
49 people
Have him in circles
17 people
Danuja Dabare's profile photo
Ellie Fischer's profile photo
Kris Wenzel's profile photo
D'kyn Fehr's profile photo
ITMaple.com's profile photo
override1960's profile photo
BARRY JOANS's profile photo
amber mccormick's profile photo
eric arriaga's profile photo
Education
  • Rogue Community College
    present
    BS/ Transfer - SOU (Computer Network Security and System Information Assurance)
  • Grants Pass High School
    1999 - 2003
Basic Information
Gender
Male
Looking for
Networking
Work
Occupation
Network Administration/ Systems Support
Skills
Computer Network Security, Database Management, Computer Hardware, Java, Java Script, HTML, CSS, SQL.
Employment
  • Rosedale Union School District
    Systems Support Specialist, 2014 - present
  • VA
    Work Study, 2012 - 2013
    Receptionist • Answered, screened and directed inbound phone calls. • Handled general requests for information and data. • Maintained and organized sensitive client files.
  • USN
    Operation Specialist, 2007 - 2012
    Operations Lead Project Manager • Managed and directly supervised a division of 26 while at 80% manning. • Scheduled all short and long term company maintenance; conceived, developed, and instituted a robust schedule using calculated combinations of logistics, personnel and maintenance resources to optimize output. • Sought as top mentor within company; goal-oriented team player recognized for strong communication skills. Fitness Director and Trainer • Lead weekly fitness sessions for over 300 company employees; directly managed fitness standards and personally entered and verified accuracy of database for 55 employees. • Ambassador of America hospitality and culture during joint operations with foreign nations. Data Exchange Specialist • Utilized advanced communications technology to build and coordinate massive tactical data exchange and networking between over a dozen nations in support of deployment counter-piracy missions. • Provided identification data critical to national security to top decision-makers… • Organized and briefed top company executives and their staff of 30+ tacticians daily to direct company coordination while performing in multi-national deployment operations; critical to data exchange between over a dozen nations in support of counter-piracy operations. • Managed Complicated Multi-Network Architectures, including directing, trouble shooting of 20+ warships.
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Bakersfield CA
Previously
Medford OR - Grants Pass OR - Everett WA
Links