enediel gonzalez | 7 Sep 00:36

error accesing postgresql manually from netbeans

Hello:
I have the following code to connect to postgresql

protected boolean Open(){
    boolean aResult = false;
    try{
       /*
      //String url = "jdbc:postgresql://" + _host + "/" + _database; 
        String url = "jdbc:postgresql://" + _host + ";user=" + _userName + ";password=" + _userPassword; 
      Class.forName ("org.postgresql.Driver").newInstance(); 
      //Connection PostgreSQLConnector = DriverManager.getConnection (url, _userName, _userPassword);
      Connection PostgreSQLConnector = DriverManager.getConnection (url);
      _connectionObject = PostgreSQLConnector;
      aResult = true;
        */
      //String url = "jdbc:postgresql://" + _host + ":" + _port + "/" + _database; 
      String url = "jdbc:postgresql://" + _host + ":" + _port + "/" + _database +
              "?user=" + _userName + "&password=" + _userPassword;
      /*
      Properties props = new Properties();
      props.setProperty("user",_userName);
      props.setProperty("password",_userPassword);
      props.setProperty("ssl","false");
       */
      Connection PostgreSQLConnector = DriverManager.getConnection(url);
      _connectionObject = PostgreSQLConnector;
      aResult = true;
    }
    catch (Exception e){
    } 
   
    return aResult;
  }

In comments you can see the different ways I tried , but basically I'm able to connect without any exception generated.

I want to execute a simple query to the server that returns me a value


public String Query_Execute_GetValue(String query){
    String aResult = null;
    try{
      Connection ServerConnector = (Connection)_connectionObject; 
      Statement statement = ServerConnector.createStatement();
      ResultSet RecordSet = statement.executeQuery(query);     
      if (RecordSet.first())
        aResult = new String(RecordSet.getString("pk"));
    }
    catch (Exception e){

    }   
    return aResult;
  }

the line
if (RecordSet.first()) always is false even when the simple query I tested with another client and return me the right value.

Thanks in advance for any help.

Enediel


Get news, entertainment and everything you care about at Live.com. Check it out!
lekdu | 6 Sep 20:16

Web Application without netbeans

Hi everybody, I dont know if this topic is in the forum but anyway a need some help. Right now Im finishing a web
application with netbeans 6.1 and Apache, i close to finish it, but i dont know how to install the web
application on the computer of my client and make it work without netbeans.

Please someone help me and thanks.

t_ras | 6 Sep 17:25

Binding a view or query to list\table

Hi,

I managed to easily connect tables to a jTable element, but fail to cnnect to table (or list) a view or a free
sql query. I'm wokring with MySQL and NB6.1.

What is the procedure to do the above? 

Thanks

daik | 6 Sep 13:22

External libraries when coding C++

Hello all, 

I've just recently installed the C++ module in Netbeans 6.1 to code some C++. I need to define an external
library to use (irrlicht in my case), how do I do this? I go to "project properties" but can't find any way of
putting any additional paths in. All the options under "project properties-general" are:

-Project folder

-Compiler collection (GNU compiler collection)

-C compiler required (ticked)

-C++ compiler required (ticked)

-Platform (Linux x86)

-Configuration type (Application)

I post the menu options for general as I've found some netbeans tutorials that point me to here to add an
additional directory, but there is no such option, so how do I do that?

Javed Anjum | 6 Sep 11:14

please bug a small prog in visual web JSF project

Dear Roman,
 
We have mailed each other before but i am not sure u could recognize me..any way I am
just beginner in netbeans 6.5 beta & i found 1 bug..
 
that is..I gone through ur tutorial named.."Building a tree from a
DataBase Data - Netbeans IDE 6_1 Tutorial.htm" and "Using Databound
Components to Access a Database - NetBeans IDE 6_5 Tutorial.htm"
that i downloaded..and in both the process i could not successfully completed the project in "Visual Web JSF application project" because  
the "components like Tree" and "DropDownList" that were made in
visual
page ,i.e "Page1.jsp" are not recognized in its managed-bean-class 
i,e "Page1.java"...please let me know how i would rectify the
problem..
 
I have ma iled u an attachment..please revert me after rectification
Thanking You,
 
Jawed Anjum
India
 91-9337439779
jawed.anjum <at> yahoo.com mailto:jawed.anjum <at> yahoo.com
 
Please reply ASAP.
 

Adam78 | 6 Sep 10:36

JComboBox Binding


Hi all, I have a little database programming experience with VB.Net but Java
persistence seems quite different. I have what I would think is a common
task though I cannot find adequate help so thought you guys may help me out.
I have dropped a combobox on my design screen and then dragged a database
column into it, I have also created a cellrenderer and the combo lists the
values perfectly. The problem is that when the selected index is changed in
the combo, I wish to update all the other textfields according to the
selected value, ie change rows. (combobox navigation)
So I have the selected index now I need to somehow set the position so that
the other fields update.
Please help, this is driving me nuts :), Thanks in advance.
--

-- 
View this message in context: http://www.nabble.com/JComboBox-Binding-tp19344281p19344281.html
Sent from the Netbeans - Users mailing list archive at Nabble.com.

NB editors keeps error while build/run is OK

Hello,

This is not directly related to OpenESB but to Netbeans.

I have ProjectEJB A and ProjectCommandLine B
ProjectB has a reference to ProjectA in Properties -> Libraries

I can compile and run ProjectB.  However, in ProjectB, NB editor  
underlines all code lines related to ProjectA and says it can not find  
the package.  All java files and ProjectB itself is tagged with the  
red icon, like if I had an error.

Bug in NB editor ?  Any workaround ?

Thanks

Seb
---
Sébastien Stormacq
Senior Software Architect
GSS Software Practice,
Sun Microsystems Luxembourg

Attachment (smime.p7s): application/pkcs7-signature, 2435 bytes
MrAllender | 6 Sep 01:30

Noob Jframe question

Hey everyone,  I'm pretty new to this whole java gui stuff so bare with me please.  I had created a new JFrame
using the netbeans new>create JFrame form with some components inside, I created it and it works how I want
it to work.  What I want, though, is to turn this into a JPanel so I can attach it to a certain java program.

Is there any easy way of doing this?

if not, what would I need to do to make this work?

Hope my problem was explained clear enough, Thanks!

Sam Mela | 6 Sep 09:53

Is the concept of a Library Native to NetBeans???

From what I can tell, the way NetBeans uses libraries as a collection of pointers to Jar Resources.  The library does not physically exist as a folder.  Is this correct?
 
If this is correct, where are the global library definitions actually stored?
 
Thanks,
 
Sam
MrChang | 6 Sep 06:03

jform


hi i have many questions

1. i created jfrom in netbeans but how to make that form appear maximize. i
tried to change windows state but not working.

2. how to install jarvis - jasper report
   i have already installed in my computer but not working, there is an
error message

thanks..
--

-- 
View this message in context: http://www.nabble.com/jform-tp19342869p19342869.html
Sent from the Netbeans - Users mailing list archive at Nabble.com.

JulioSergio | 6 Sep 01:13

A simple application that dispatches two desktop applications


I have made a simple application that dispatches any of two desktop
applications, depending on the button depressed. 
The appeareance of the aplication is shown in the figure below:

http://www.nabble.com/file/p19341104/Dispatcher.png 

I simply set as the action of the buttons the following methods:

    private void MandaProceso(String PName) {

        // The Process Name is given as argument: PName. We use it to
        // build up the directory where the jar File is.

        ProcessBuilder pb = new ProcessBuilder();
        Map<String, String> env = pb.environment();

        // First, the value of the environment variable $HOME
        // is found:

        String Home = env.get("HOME");

        // The site for the 'jar' file is:
        String DirName = Home + "/NetBeansProjects/" + PName + "/dist";

        // We establish this as the current directory
        pb.directory(new File(DirName));

        // and the command to be executed is:
        pb.command("java", "-jar", PName + ".jar");

        try {
            Process p = pb.start(); // The process is started.
        } catch (IOException ex) {

Logger.getLogger(DispatcherView.class.getName()).log(Level.SEVERE, null,
ex);
        }
    }

    /**
     * Calls MandaProceso("EditaFOptions"), which dispatches the
     * process java -jar EditaFOptions.jar
     */
    @Action
    public void MandaProcesoFO() {
        MandaProceso("EditaFOptions");
    }

    /**
     * Calls MandaProceso("EditaTema"), which dispatches the
     * process java -jar EditaTema.jar
     */
    @Action
    public void MandaProcesoET() {
        MandaProceso("EditaTema");
    }

Since both processes associated with the buttons were built as Netbeans
projects, I wonder if there is a way to attach 
their "Views" (or Frame Views) to the master Desktop application without the
need of calling them as processes from the 
operating system.

Any advice will be very appreciated,

Sergio.

--

-- 
View this message in context: http://www.nabble.com/A-simple-application-that-dispatches-two-desktop-applications-tp19341104p19341104.html
Sent from the Netbeans - Users mailing list archive at Nabble.com.


Gmane