Archive for the 'database' Category

11
Jun
09

sqlplus : ORA-12154

I have been facing this issue with sqlplus for quite sometime and have been ignoring it with shortage of time as an excuse. But i couldn’t avoid any further given that i had to do lot of DB stuff recently and i needed it running fine.

Issue:

I have TOAD, SQL Developer and SQLPlus all installed. I was able to connect to my db using TOAD and SQL Developer without issues but whenever i tried connecting using SQLPlus with same db/schema/pwd it threw up following error message,

ORA-12154: TNS:could not resolve the connect identifier specified

Strange!!!. There aint any issue with tnsnames.ora or sqlnet.ora since it is being used by other tools and they work fine. I googled around and did checks here n there but no help.

Resolution:

I happened to read somewhere that some special characters like @ etc. have special meaning for sqlplus and using them in userid/password confuses it. I had an @ in my password and that was the reason for this error. I changed my pwd and it worked like charm. :)

 

31
May
07

JAX India 2007 – Bangalore day 3

Below is the coverage of todays sessions and my takeaways. The slides for all presentations are available here.

JSF and AJAX : Best of Friends (by Craig McClanahan, SUN Microsystems)

  • The motive was to convey various means of achieving AJAX while using JSF. Though all means are workarounds in my opinion. JSF specification should have built-in support for AJAX. It lost out in this front because of the delay in finalizing the specification and AJAX peaking up during the same time.
  • The means are : (a) DIY (Do It Yourself) (b) Use JSF components with native AJAX (c) Wrap client side JS libraries (d) Make non-JSF calls to the web server.
  • DIY – Most JSF components have JS event methods. Leverage that along with own JS methods and XMLHttpRequest or other client side JS toolkit like Dojo, Prototype or Scriptaculus. Involves lot of work. Implementing page refresh might be tricky.
  • JSF with native AJAX – Components take care of making async calls and updating DOM. Simpler to use. Loads of OSS and commercial ajaxified JSF components available. e.g ADFFaces, MyFaces, etc
  • Wrap JS libs – Strongly suggested Jmaki which wraps different client side AJAX libraries like dojo, prototype etc.
  • Make non-JSF calls – You can choose to use any of the AJAX libraries and make them talk to a servlet directly instead of going thru the JSF life cycle. Handling the component tree update will be tricky.
  • choose any of the above options based on whether you need to keep the component tree in sync with the DOM updates.

Should you adopt/migrate to Struts 2.0? (by Harshad Oak, Rightrix Solutions)

  • Provides an overview of new features of Struts in 2.0 release. Its basically like Struts 1 + WebWork = Struts 2.
  • Features include annotation support, interceptors through servlet filters, convention over configuration, derive method name from URL, concept of value stack, new tag libraries, a Guice based minimal DI container to integration with Spring, no form beans etc
  • Integration points for Spring, AJAX frameworks like dojo, GWT etc.
  • Package names now contain com.opensymphony.*.
  • Migration from Struts 1 to Struts 2 is difficult because of such drastic changes but migration from Webwork is lot easier.

My opinion – its a mess now, it is dieing. The code code sample he shown looked lot messier, a result of merging two frameworks. The author himself seemed directionless like the framework and mostly tried to highlight that the framework supports all the buzz words in web framework market these days. Guess Webwork is banking on Strut’s image now to sell itself. :( Pity for both of them. Good for us (developers) since we have two frameworks less to worry about now.

Can tools improve even a power geeks productivity? (by Craig McClanahan, SUN Microsystems)

  • Brings out the point that geeks who like playing with their good old editors using the combination of hot keys and the keyboard, can be more productive if the IDE has appropriate features.
  • Few features that makes a java IDE good are – documentation lookup, refactoring, real time debugging, unit testing support, version control support, database administration, deployment, generate boiler plate and plumbing code, allow maven / ant structuring, integrate runtime dependencies, heterogeneous programming language support, generate skeleton OR mapping and support for popular frameworks etc.
  • Demonstrated Netbeans IDE supporting these features, though he named Eclipse in the context. So i would not say that we was solely pushing the SUN product by throwing a catchy session title.

You can’t just buy an Open Source community (by Neelan Choksi, COO Interface21)

  • This talk was to highlight that all the commercial vendors taking the open source route to stay in business will not succeed. They can not buy the community by open sourcing their products e.g OpenJDK, OpenJPA, JBuilder etc etc.
  • The only sensible thing he talked about – Community is the most important factor in success of open source projects. You need to build community and their are few approaches to do that.

Otherwise the talk was complete waste of time. More focused on picking up failures from rivals and quoting Interface21 as the rightest thing to ever happen. The less you write about his presentation skills, on stage persona and language command the better it is for Interface21. An instance of catchy title but patchy content. :(

Why is everyone so excited about Ruby-on-Rails (by Neal Ford, Thoughtworks)

  • Title says it all – marketing of RoR. However i still wanted to attend to see whats inside RoR. And to be honest, i was taken aback, throughly surprised with zillions of questions shooting here n there in my mind.
  • Few features – RAD development (they mean it, needs to be seen if it works in enterprise apps), agility, instant feedback, OR mapping via ActiveRecord, no compile/deploy etc, scaffolding, testing generation, web 2.o support etc.
  • Follows standard folder structure which helps in getting rid of configuration files, making safe assumptions. Generates method code at runtime based on need.
  • Recommends Streamlines, a 3rd party scaffolding library.
  • Admits it slowness now but expects drastic improvements in next release.

my thoughts – this is a completely different way of developing web apps. Given the productivity features and all the buzz around it, i feel the time has come for a try on it for an agile development project.

SOA: The future of distributed computing? (by Neal Ford, Thoughtworks)

  • I am not a SOA fanboy but attended it since none other parallel session were any better. Not sure if i followed him properly but i guess he started with bashing SOA and ended with the note that it has the best chance to work this time for distributed computing.
  • One should download the slides from his website and go thru it. Its pretty humorous and informative at the same time.

Overall, one key point to note is that the audience is much more patient and lenient while listening to the established speakers as against the local ones. I had expected more skilled and professional audience since most of them are at architect or designer level. But few basic ethics like allowing the speaker to cover the topic before asking ahead or out of context questions, things like limiting conversations to certain iterations etc were clearly missing and thus few of the sessions were reduced to mere show-off events than for knowledge exchange.

23
Jul
06

XML & RDBMS auto mapping?

Recently i was given a problem to solve. Its not an uncommon problem neither is the solution very tricky but the team facing the problem was so constrained on time that none of the proven solutions seemed like ‘a solution’.

The problem :-

I have an XML data file that needs to be populated into a set of RDBMS tables. The XML is nested upto three levels deep and i didn’t get a chance to ask for the table structure.

The Solutions :-

I know what you are thinking – its a very simple problem. We face it day in day out. Agreed. Lets see what solutions come to mind immediately,

>1> Bind XML to Java objects and persist them using JDBC.

There are utilities like JAXB, Castor, XmlBeans which help in converting between XML and Java. They either work on a mapping file or take XML Schema as input to generate the Java classes. If you know you java classes then you map them into XML nodes and elements or you use the XML schema to generate java classes. Once you have unmarshalled your XML into Java you can either use JDBC or any OR mapping solution to persist them into relational tables.

>2> Use tools to map XML and Relational tables.

There are a lot of open source (e.g. DBMT, JDBCImporter, myXDM) and commercial tools (e.g. Altova MapForce) available which promise to relieve you of the coding by allowing you to map XML schema to Database schema directly. The tools then use that mapping as information and perform the conversions.

>3> Use the RDBMS’ XML toolsets

Realising the importance of XML as data communication channel some databases have started providing tool kits to help perform many trivial tasks related to XML and RDBMS. Based on your target database you should lookout for such toolkits too. Oracle provides XDK which can do conversion provided the input XML adheres to Oracle’s defined schema. This means i need to do XSL transformation on my input XML to generate the Oracle specified XML format to persist it into tables.

These three solutions came to my mind and i proposed too. But if you notice all of them need some kind of coding or XML mapping. But the team was in such a time schedule that it had no bandwidth and CPU cycles to perform even this task. This is where i felt, there should be a tool which could explore the XML schema and database schema and auto map. This need not be a 100% correct mapping but even if it does some percentage, it gives the team a start-up.




History

Blog Stats

  • 125,713 views

Bookmarks