Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in output  RSS feed

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello, I have created the following program in net beans(database connection). I set up odbc connection also. Data source name-student. But when i run the program, no output is displayed. can you please tell, why output is not displayed?
 
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check that the data got inserted in the database?
 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

No, i didn't check. I am using sql server 2005. should i create the table already?Should i set odbc connection every time before running the program?
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dhivya rajagopal wrote:
No, i didn't check. I am using sql server 2005. should i create the table already?Should i set odbc connection every time before running the program?


There should be a table created before you insert some data into it. Creating a table is a one time and it can be done manually by running the SQL queries.
 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you mohamed. I created one table . and run the program, I get the following error:

JDBC CONNECTION
**** **********
SQL EXCEPTION:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
BUILD SUCCESSFUL (total time: 2 seconds)
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dhivya rajagopal wrote:

JDBC CONNECTION
**** **********
SQL EXCEPTION:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
BUILD SUCCESSFUL (total time: 2 seconds)


So the error message says what you are missing- user, password
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can spend sometime in reading this tutorial on JDBC
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!